1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Rename addressSlicer function to shortenAddress (#8408)

This commit is contained in:
Erik Marks 2020-04-24 09:52:09 -07:00 committed by GitHub
parent bace02ad02
commit 266d6e67fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 12 deletions

View File

@ -7,7 +7,7 @@ import {
import { getEnvironmentType } from '../../../../../../app/scripts/lib/util'
import NetworkDisplay from '../../network-display'
import Identicon from '../../../ui/identicon'
import { addressSlicer } from '../../../../helpers/utils/util'
import { shortenAddress } from '../../../../helpers/utils/util'
export default class ConfirmPageContainerHeader extends Component {
static contextTypes = {
@ -65,7 +65,7 @@ export default class ConfirmPageContainerHeader extends Component {
/>
</div>
<div className="confirm-page-container-header__address">
{ addressSlicer(accountAddress) }
{ shortenAddress(accountAddress) }
</div>
</div>
)

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import copyToClipboard from 'copy-to-clipboard'
import { addressSlicer, checksumAddress } from '../../../helpers/utils/util'
import { shortenAddress, checksumAddress } from '../../../helpers/utils/util'
import Tooltip from '../../ui/tooltip-v2.js'
@ -42,7 +42,7 @@ class SelectedAccount extends Component {
{ selectedIdentity.name }
</div>
<div className="selected-account__address">
{ addressSlicer(checksummedAddress) }
{ shortenAddress(checksummedAddress) }
</div>
</div>
</Tooltip>

View File

@ -5,7 +5,7 @@ import Identicon from '../identicon'
import Tooltip from '../tooltip-v2'
import copyToClipboard from 'copy-to-clipboard'
import { DEFAULT_VARIANT, CARDS_VARIANT, FLAT_VARIANT } from './sender-to-recipient.constants'
import { checksumAddress, addressSlicer } from '../../../helpers/utils/util'
import { checksumAddress, shortenAddress } from '../../../helpers/utils/util'
const variantHash = {
[DEFAULT_VARIANT]: 'sender-to-recipient--default',
@ -66,7 +66,7 @@ export default class SenderToRecipient extends PureComponent {
? <p>{t('copyAddress')}</p>
: (
<p>
{addressSlicer(checksummedSenderAddress)}<br />
{shortenAddress(checksummedSenderAddress)}<br />
{t('copyAddress')}
</p>
)
@ -126,7 +126,7 @@ export default class SenderToRecipient extends PureComponent {
? <p>{t('copyAddress')}</p>
: (
<p>
{addressSlicer(checksummedRecipientAddress)}<br />
{shortenAddress(checksummedRecipientAddress)}<br />
{t('copyAddress')}
</p>
)

View File

@ -267,7 +267,7 @@ export function checksumAddress (address) {
return checksummed
}
export function addressSlicer (address = '') {
export function shortenAddress (address = '') {
if (address.length < 11) {
return address
}

View File

@ -26,7 +26,7 @@ import { getHexGasTotal } from '../../helpers/utils/confirm-tx.util'
import { isBalanceSufficient, calcGasTotal } from '../send/send.utils'
import { conversionGreaterThan } from '../../helpers/utils/conversion-util'
import { MIN_GAS_LIMIT_DEC } from '../send/send.constants'
import { checksumAddress, addressSlicer, valuesFor } from '../../helpers/utils/util'
import { checksumAddress, shortenAddress, valuesFor } from '../../helpers/utils/util'
import { getMetaMaskAccounts, getCustomNonceValue, getUseNonceField, getAdvancedInlineGasShown, preferencesSelector, getIsMainnet, getKnownMethodData } from '../../selectors/selectors'
import { transactionFeeSelector } from '../../selectors/confirm-transaction'
@ -89,7 +89,7 @@ const mapStateToProps = (state, ownProps) => {
: (
casedContractMap[toAddress]
? casedContractMap[toAddress].name
: addressSlicer(checksumAddress(toAddress))
: shortenAddress(checksumAddress(toAddress))
)
const checksummedAddress = checksumAddress(toAddress)

View File

@ -6,7 +6,7 @@ import { createSelector } from 'reselect'
import abi from 'human-standard-token-abi'
import { multiplyCurrencies } from '../helpers/utils/conversion-util'
import {
addressSlicer,
shortenAddress,
checksumAddress,
getOriginFromUrl,
getAccountByAddress,
@ -217,7 +217,7 @@ export function getAddressBookEntry (state, address) {
export function getAddressBookEntryName (state, address) {
const entry = getAddressBookEntry(state, address) || state.metamask.identities[address]
return entry && entry.name !== '' ? entry.name : addressSlicer(address)
return entry && entry.name !== '' ? entry.name : shortenAddress(address)
}
export function getDaiV1Token (state) {