From 266d6e67fed2e2d883089b2724f921568df3b8aa Mon Sep 17 00:00:00 2001
From: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Date: Fri, 24 Apr 2020 09:52:09 -0700
Subject: [PATCH] Rename addressSlicer function to shortenAddress (#8408)
---
.../confirm-page-container-header.component.js | 4 ++--
.../app/selected-account/selected-account.component.js | 4 ++--
.../ui/sender-to-recipient/sender-to-recipient.component.js | 6 +++---
ui/app/helpers/utils/util.js | 2 +-
.../confirm-transaction-base.container.js | 4 ++--
ui/app/selectors/selectors.js | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js
index a36c0997e..620e54897 100644
--- a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js
+++ b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js
@@ -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 {
/>
- { addressSlicer(accountAddress) }
+ { shortenAddress(accountAddress) }
)
diff --git a/ui/app/components/app/selected-account/selected-account.component.js b/ui/app/components/app/selected-account/selected-account.component.js
index 5b7936656..c9561f820 100644
--- a/ui/app/components/app/selected-account/selected-account.component.js
+++ b/ui/app/components/app/selected-account/selected-account.component.js
@@ -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 }
- { addressSlicer(checksummedAddress) }
+ { shortenAddress(checksummedAddress) }
diff --git a/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js b/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js
index 2780456d6..e1021e738 100644
--- a/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js
+++ b/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js
@@ -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 {
? {t('copyAddress')}
: (
- {addressSlicer(checksummedSenderAddress)}
+ {shortenAddress(checksummedSenderAddress)}
{t('copyAddress')}
)
@@ -126,7 +126,7 @@ export default class SenderToRecipient extends PureComponent {
? {t('copyAddress')}
: (
- {addressSlicer(checksummedRecipientAddress)}
+ {shortenAddress(checksummedRecipientAddress)}
{t('copyAddress')}
)
diff --git a/ui/app/helpers/utils/util.js b/ui/app/helpers/utils/util.js
index 21a864d81..25e00fbd7 100644
--- a/ui/app/helpers/utils/util.js
+++ b/ui/app/helpers/utils/util.js
@@ -267,7 +267,7 @@ export function checksumAddress (address) {
return checksummed
}
-export function addressSlicer (address = '') {
+export function shortenAddress (address = '') {
if (address.length < 11) {
return address
}
diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js
index eedcd96e6..5917ebf71 100644
--- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js
+++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js
@@ -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)
diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js
index 50a8dbff8..aeeef3059 100644
--- a/ui/app/selectors/selectors.js
+++ b/ui/app/selectors/selectors.js
@@ -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) {