mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Consolidate and dedupe send selectors (#8506)
* consolidate & dedupe send selectors
This commit is contained in:
parent
eacdb5d920
commit
e8fa0b7b5d
@ -1,10 +1,6 @@
|
||||
import assert from 'assert'
|
||||
import * as selectors from '../../../../ui/app/selectors'
|
||||
import mockState from '../../../data/mock-state.json'
|
||||
import Eth from 'ethjs'
|
||||
import { createTestProviderTools } from '../../../stub/provider'
|
||||
|
||||
const provider = createTestProviderTools({ scaffold: {} }).provider
|
||||
|
||||
describe('Selectors', function () {
|
||||
|
||||
@ -21,9 +17,13 @@ describe('Selectors', function () {
|
||||
})
|
||||
|
||||
it('returns selected identity', function () {
|
||||
const identity = selectors.getSelectedIdentity(mockState)
|
||||
assert.equal(identity.address, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
|
||||
assert.equal(identity.name, 'Test Account')
|
||||
assert.deepEqual(
|
||||
selectors.getSelectedIdentity(mockState),
|
||||
{
|
||||
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
||||
name: 'Test Account',
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('returns selected account', function () {
|
||||
@ -76,22 +76,11 @@ describe('Selectors', function () {
|
||||
assert.equal(gasIsLoading, false)
|
||||
})
|
||||
|
||||
it('#getSendAmount', function () {
|
||||
const sendAmount = selectors.getSendAmount(mockState)
|
||||
assert.equal(sendAmount, '1bc16d674ec80000')
|
||||
})
|
||||
|
||||
it('#getCurrentCurrency', function () {
|
||||
const currentCurrency = selectors.getCurrentCurrency(mockState)
|
||||
assert.equal(currentCurrency, 'usd')
|
||||
})
|
||||
|
||||
it('#getSelectedTokenContract', function () {
|
||||
global.eth = new Eth(provider)
|
||||
const selectedTokenContract = selectors.getSelectedTokenContract(mockState)
|
||||
assert(selectedTokenContract.abi)
|
||||
})
|
||||
|
||||
it('#getTotalUnapprovedCount', function () {
|
||||
const totalUnapprovedCount = selectors.getTotalUnapprovedCount(mockState)
|
||||
assert.equal(totalUnapprovedCount, 1)
|
||||
|
@ -3,8 +3,11 @@ import { withRouter } from 'react-router-dom'
|
||||
import { connect } from 'react-redux'
|
||||
import AccountDetailsDropdown from './account-details-dropdown.component'
|
||||
import * as actions from '../../../../store/actions'
|
||||
import { getSelectedIdentity, getRpcPrefsForCurrentProvider } from '../../../../selectors'
|
||||
import genAccountLink from '../../../../../lib/account-link.js'
|
||||
import {
|
||||
getSelectedIdentity,
|
||||
getRpcPrefsForCurrentProvider,
|
||||
} from '../../../../selectors'
|
||||
import genAccountLink from '../../../../../lib/account-link'
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
|
@ -42,11 +42,10 @@ import {
|
||||
getBasicGasEstimateBlockTime,
|
||||
getTxParams,
|
||||
isCustomPriceSafe,
|
||||
} from '../../../../selectors'
|
||||
import {
|
||||
getTokenBalance,
|
||||
getSendMaxModeState,
|
||||
} from '../../../../selectors/send'
|
||||
} from '../../../../selectors'
|
||||
|
||||
import {
|
||||
formatCurrency,
|
||||
} from '../../../../helpers/utils/confirm-tx.util'
|
||||
|
@ -35,20 +35,18 @@ proxyquire('../gas-modal-page-container.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../selectors/': {
|
||||
'../../../../selectors': {
|
||||
getBasicGasEstimateLoadingStatus: (s) => `mockBasicGasEstimateLoadingStatus:${Object.keys(s).length}`,
|
||||
getRenderableBasicEstimateData: (s) => `mockRenderableBasicEstimateData:${Object.keys(s).length}`,
|
||||
getDefaultActiveButtonIndex: (a, b) => a + b,
|
||||
getCurrentEthBalance: (state) => state.metamask.balance || '0x0',
|
||||
getSelectedToken: () => null,
|
||||
getTokenBalance: (state) => state.metamask.send.tokenBalance || '0x0',
|
||||
},
|
||||
'../../../../store/actions': actionSpies,
|
||||
'../../../../ducks/gas/gas.duck': gasActionSpies,
|
||||
'../../../../ducks/confirm-transaction/confirm-transaction.duck': confirmTransactionActionSpies,
|
||||
'../../../../ducks/send/send.duck': sendActionSpies,
|
||||
'../../../../selectors/send': {
|
||||
getTokenBalance: (state) => state.metamask.send.tokenBalance || '0x0',
|
||||
},
|
||||
})
|
||||
|
||||
describe('gas-modal-page-container container', function () {
|
||||
|
@ -1,6 +1,9 @@
|
||||
import { connect } from 'react-redux'
|
||||
import { showModal, setAccountLabel } from '../../../../store/actions'
|
||||
import { getSelectedIdentity, getRpcPrefsForCurrentProvider } from '../../../../selectors'
|
||||
import {
|
||||
getSelectedIdentity,
|
||||
getRpcPrefsForCurrentProvider,
|
||||
} from '../../../../selectors'
|
||||
import AccountDetailsModal from './account-details-modal.component'
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
|
@ -1,8 +1,11 @@
|
||||
import { connect } from 'react-redux'
|
||||
import CurrencyInput from './currency-input.component'
|
||||
import { ETH } from '../../../helpers/constants/common'
|
||||
import { getSendMaxModeState } from '../../../selectors/send'
|
||||
import { getIsMainnet, preferencesSelector } from '../../../selectors'
|
||||
import {
|
||||
getSendMaxModeState,
|
||||
getIsMainnet,
|
||||
preferencesSelector,
|
||||
} from '../../../selectors'
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state
|
||||
|
@ -3,7 +3,10 @@ import { captureException } from '@sentry/browser'
|
||||
|
||||
import actionConstants from '../../store/actionConstants'
|
||||
import { addPermittedAccount } from '../../store/actions'
|
||||
import { getOriginOfCurrentTab, getSelectedAddress } from '../../selectors'
|
||||
import {
|
||||
getOriginOfCurrentTab,
|
||||
getSelectedAddress,
|
||||
} from '../../selectors'
|
||||
|
||||
// Constants
|
||||
|
||||
|
@ -9,7 +9,6 @@ import {
|
||||
getAccountType,
|
||||
getNumberOfAccounts,
|
||||
getNumberOfTokens,
|
||||
|
||||
txDataSelector,
|
||||
} from '../../../selectors'
|
||||
|
||||
|
@ -7,7 +7,6 @@ import {
|
||||
getAccountsWithLabels,
|
||||
getLastConnectedInfo,
|
||||
getTargetDomainMetadata,
|
||||
|
||||
getPermissionDomains,
|
||||
} from '../../selectors'
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { connect } from 'react-redux'
|
||||
import {
|
||||
getNativeCurrency,
|
||||
} from '../../../selectors/send'
|
||||
import {
|
||||
getIsMainnet,
|
||||
isBalanceCached,
|
||||
preferencesSelector,
|
||||
|
@ -10,12 +10,10 @@ proxyquire('../account-list-item.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../selectors/send': {
|
||||
'../../../selectors': {
|
||||
getConversionRate: () => `mockConversionRate`,
|
||||
getCurrentCurrency: () => `mockCurrentCurrency`,
|
||||
getNativeCurrency: () => `mockNativeCurrency`,
|
||||
},
|
||||
'../../../selectors/': {
|
||||
isBalanceCached: () => `mockBalanceIsCached`,
|
||||
preferencesSelector: ({ showFiatInTestnets }) => ({
|
||||
showFiatInTestnets,
|
||||
|
@ -2,12 +2,11 @@ import { connect } from 'react-redux'
|
||||
import {
|
||||
getSendEnsResolution,
|
||||
getSendEnsResolutionError,
|
||||
} from '../../../../selectors/send'
|
||||
import {
|
||||
accountsWithSendEtherInfoSelector,
|
||||
getAddressBook,
|
||||
getAddressBookEntry,
|
||||
} from '../../../../selectors'
|
||||
|
||||
import {
|
||||
updateSendTo,
|
||||
} from '../../../../store/actions'
|
||||
|
@ -1,14 +1,11 @@
|
||||
import { connect } from 'react-redux'
|
||||
import EnsInput from './ens-input.component'
|
||||
import {
|
||||
getCurrentNetwork,
|
||||
getSendTo,
|
||||
getSendToNickname,
|
||||
} from '../../../../selectors/send'
|
||||
import {
|
||||
getAddressBookEntry,
|
||||
} from '../../../../selectors'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
|
||||
export default connect(
|
||||
(state) => {
|
||||
|
@ -17,11 +17,9 @@ proxyquire('../add-recipient.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../selectors/send': {
|
||||
'../../../../selectors': {
|
||||
getSendEnsResolution: (s) => `mockSendEnsResolution:${s}`,
|
||||
getSendEnsResolutionError: (s) => `mockSendEnsResolutionError:${s}`,
|
||||
},
|
||||
'../../../../selectors/': {
|
||||
getAddressBook: (s) => [{ name: `mockAddressBook:${s}` }],
|
||||
getAddressBookEntry: (s) => `mockAddressBookEntry:${s}`,
|
||||
accountsWithSendEtherInfoSelector: (s) => `mockAccountsWithSendEtherInfoSelector:${s}`,
|
||||
|
@ -5,8 +5,8 @@ import {
|
||||
getSendFromBalance,
|
||||
getTokenBalance,
|
||||
getSendMaxModeState,
|
||||
} from '../../../../../selectors/send'
|
||||
import { getBasicGasEstimateLoadingStatus } from '../../../../../selectors'
|
||||
getBasicGasEstimateLoadingStatus,
|
||||
} from '../../../../../selectors'
|
||||
import { calcMaxAmount } from './amount-max-button.utils.js'
|
||||
import {
|
||||
updateSendAmount,
|
||||
|
@ -21,15 +21,15 @@ proxyquire('../amount-max-button.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../../selectors/send': {
|
||||
'../../../../../selectors': {
|
||||
getGasTotal: (s) => `mockGasTotal:${s}`,
|
||||
getSelectedToken: (s) => `mockSelectedToken:${s}`,
|
||||
getSendFromBalance: (s) => `mockBalance:${s}`,
|
||||
getTokenBalance: (s) => `mockTokenBalance:${s}`,
|
||||
getSendMaxModeState: (s) => `mockMaxModeOn:${s}`,
|
||||
getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}`,
|
||||
},
|
||||
'./amount-max-button.utils.js': { calcMaxAmount: (mockObj) => mockObj.val + 1 },
|
||||
'../../../../../selectors/': { getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}` },
|
||||
'../../../../../store/actions': actionSpies,
|
||||
'../../../../../ducks/send/send.duck': duckActionSpies,
|
||||
})
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
getTokenBalance,
|
||||
getSendMaxModeState,
|
||||
sendAmountIsInError,
|
||||
} from '../../../../selectors/send'
|
||||
} from '../../../../selectors'
|
||||
import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils'
|
||||
import {
|
||||
setMaxModeTo,
|
||||
|
@ -19,7 +19,7 @@ proxyquire('../send-amount-row.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../selectors/send': { sendAmountIsInError: (s) => `mockInError:${s}` },
|
||||
'../../../../selectors': { sendAmountIsInError: (s) => `mockInError:${s}` },
|
||||
'../../send.utils': {
|
||||
getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }),
|
||||
getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }),
|
||||
|
@ -2,11 +2,10 @@ import { connect } from 'react-redux'
|
||||
import SendContent from './send-content.component'
|
||||
import {
|
||||
getSendTo,
|
||||
} from '../../../selectors/send'
|
||||
import {
|
||||
accountsWithSendEtherInfoSelector,
|
||||
getAddressBookEntry,
|
||||
} from '../../../selectors'
|
||||
|
||||
import * as actions from '../../../store/actions'
|
||||
|
||||
function mapStateToProps (state) {
|
||||
|
@ -11,8 +11,6 @@ import {
|
||||
getGasLoadingError,
|
||||
gasFeeIsInError,
|
||||
getGasButtonGroupShown,
|
||||
} from '../../../../selectors/send'
|
||||
import {
|
||||
getAdvancedInlineGasShown,
|
||||
getCurrentEthBalance,
|
||||
getSelectedToken,
|
||||
|
@ -30,7 +30,7 @@ proxyquire('../send-gas-row.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../selectors/send': {
|
||||
'../../../../selectors': {
|
||||
getSendMaxModeState: (s) => `mockMaxModeOn:${s}`,
|
||||
},
|
||||
'../../send.utils.js': {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux'
|
||||
import { getSendErrors } from '../../../../../selectors/send'
|
||||
import { getSendErrors } from '../../../../../selectors'
|
||||
import SendRowErrorMessage from './send-row-error-message.component'
|
||||
|
||||
export default connect(mapStateToProps)(SendRowErrorMessage)
|
||||
|
@ -10,7 +10,7 @@ proxyquire('../send-row-error-message.container.js', {
|
||||
return () => ({})
|
||||
},
|
||||
},
|
||||
'../../../../../selectors/send': { getSendErrors: (s) => `mockErrors:${s}` },
|
||||
'../../../../../selectors': { getSendErrors: (s) => `mockErrors:${s}` },
|
||||
})
|
||||
|
||||
describe('send-row-error-message container', function () {
|
||||
|
@ -7,7 +7,6 @@ import {
|
||||
signTx,
|
||||
updateTransaction,
|
||||
} from '../../../store/actions'
|
||||
import SendFooter from './send-footer.component'
|
||||
import {
|
||||
getGasLimit,
|
||||
getGasPrice,
|
||||
@ -23,12 +22,11 @@ import {
|
||||
getUnapprovedTxs,
|
||||
getSendErrors,
|
||||
isSendFormInError,
|
||||
} from '../../../selectors/send'
|
||||
import {
|
||||
getGasIsLoading,
|
||||
getRenderableEstimateDataForSmallButtonsFromGWEI,
|
||||
getDefaultActiveButtonIndex,
|
||||
} from '../../../selectors'
|
||||
import SendFooter from './send-footer.component'
|
||||
import {
|
||||
addressIsNew,
|
||||
constructTxParams,
|
||||
|
@ -27,7 +27,7 @@ proxyquire('../send-footer.container.js', {
|
||||
},
|
||||
},
|
||||
'../../../store/actions': actionSpies,
|
||||
'../../../selectors/send': {
|
||||
'../../../selectors': {
|
||||
getGasLimit: (s) => `mockGasLimit:${s}`,
|
||||
getGasPrice: (s) => `mockGasPrice:${s}`,
|
||||
getGasTotal: (s) => `mockGasTotal:${s}`,
|
||||
@ -43,12 +43,10 @@ proxyquire('../send-footer.container.js', {
|
||||
getUnapprovedTxs: (s) => `mockUnapprovedTxs:${s}`,
|
||||
getSendErrors: (s) => `mockSendErrors:${s}`,
|
||||
isSendFormInError: (s) => `mockInError:${s}`,
|
||||
},
|
||||
'./send-footer.utils': utilsStubs,
|
||||
'../../../selectors/': {
|
||||
getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => ([{ gasEstimateType: `mockGasEstimateType:${s}` }]),
|
||||
getDefaultActiveButtonIndex: () => 0,
|
||||
},
|
||||
'./send-footer.utils': utilsStubs,
|
||||
})
|
||||
|
||||
describe('send-footer container', function () {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux'
|
||||
import { clearSend } from '../../../store/actions'
|
||||
import SendHeader from './send-header.component'
|
||||
import { getTitleKey } from '../../../selectors/send'
|
||||
import { getTitleKey } from '../../../selectors'
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(SendHeader)
|
||||
|
||||
|
@ -18,7 +18,7 @@ proxyquire('../send-header.container.js', {
|
||||
},
|
||||
},
|
||||
'../../../store/actions': actionSpies,
|
||||
'../../../selectors/send': {
|
||||
'../../../selectors': {
|
||||
getTitleKey: (s) => `mockTitleKey:${s}`,
|
||||
},
|
||||
})
|
||||
|
@ -23,11 +23,10 @@ import {
|
||||
getTokenBalance,
|
||||
getQrCodeData,
|
||||
getTokens,
|
||||
} from '../../selectors/send'
|
||||
import {
|
||||
getSelectedAddress,
|
||||
getAddressBook,
|
||||
} from '../../selectors'
|
||||
|
||||
import {
|
||||
updateSendTo,
|
||||
updateSendTokenBalance,
|
||||
|
@ -5,7 +5,7 @@ import { withRouter } from 'react-router-dom'
|
||||
import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../store/actions'
|
||||
import {
|
||||
getQrCodeData,
|
||||
} from '../../../../selectors/send'
|
||||
} from '../../../../selectors'
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
|
@ -12,6 +12,7 @@ import {
|
||||
import {
|
||||
sumHexes,
|
||||
} from '../helpers/utils/transactions.util'
|
||||
import { getNativeCurrency } from '.'
|
||||
|
||||
const unapprovedTxsSelector = (state) => state.metamask.unapprovedTxs
|
||||
const unapprovedMsgsSelector = (state) => state.metamask.unapprovedMsgs
|
||||
@ -123,7 +124,6 @@ export const unconfirmedTransactionsCountSelector = createSelector(
|
||||
|
||||
export const currentCurrencySelector = (state) => state.metamask.currentCurrency
|
||||
export const conversionRateSelector = (state) => state.metamask.conversionRate
|
||||
export const getNativeCurrency = (state) => state.metamask.nativeCurrency
|
||||
|
||||
export const txDataSelector = (state) => state.confirmTransaction.txData
|
||||
const tokenDataSelector = (state) => state.confirmTransaction.tokenData
|
||||
|
@ -3,5 +3,6 @@ export * from './custom-gas'
|
||||
export * from './first-time-flow'
|
||||
export * from './permissions'
|
||||
export * from './selectors'
|
||||
export * from './send'
|
||||
export * from './tokens'
|
||||
export * from './transactions'
|
||||
|
@ -1,14 +1,15 @@
|
||||
import { NETWORK_TYPES } from '../helpers/constants/common'
|
||||
import { stripHexPrefix, addHexPrefix } from 'ethereumjs-util'
|
||||
import { createSelector } from 'reselect'
|
||||
|
||||
import abi from 'human-standard-token-abi'
|
||||
import {
|
||||
shortenAddress,
|
||||
checksumAddress,
|
||||
getOriginFromUrl,
|
||||
getAccountByAddress,
|
||||
} from '../helpers/utils/util'
|
||||
import {
|
||||
getSelectedToken,
|
||||
} from '.'
|
||||
|
||||
export function getNetworkIdentifier (state) {
|
||||
const { metamask: { provider: { type, nickname, rpcTarget } } } = state
|
||||
@ -156,15 +157,6 @@ export function getTargetAccount (state, targetAddress) {
|
||||
return accounts[targetAddress]
|
||||
}
|
||||
|
||||
export function getSelectedToken (state) {
|
||||
const tokens = state.metamask.tokens || []
|
||||
const selectedTokenAddress = state.metamask.selectedTokenAddress
|
||||
const selectedToken = tokens.filter(({ address }) => address === selectedTokenAddress)[0]
|
||||
const sendToken = state.metamask.send && state.metamask.send.token
|
||||
|
||||
return selectedToken || sendToken || null
|
||||
}
|
||||
|
||||
export function getSelectedTokenExchangeRate (state) {
|
||||
const contractExchangeRates = state.metamask.contractExchangeRates
|
||||
const selectedToken = getSelectedToken(state) || {}
|
||||
@ -243,21 +235,10 @@ export function getGasIsLoading (state) {
|
||||
return state.appState.gasIsLoading
|
||||
}
|
||||
|
||||
export function getSendAmount (state) {
|
||||
return state.metamask.send.amount
|
||||
}
|
||||
|
||||
export function getCurrentCurrency (state) {
|
||||
return state.metamask.currentCurrency
|
||||
}
|
||||
|
||||
export function getSelectedTokenContract (state) {
|
||||
const selectedToken = getSelectedToken(state)
|
||||
return selectedToken
|
||||
? global.eth.contract(abi).at(selectedToken.address)
|
||||
: null
|
||||
}
|
||||
|
||||
export function getTotalUnapprovedCount (state) {
|
||||
const {
|
||||
unapprovedMsgCount = 0,
|
||||
|
@ -4,7 +4,6 @@ import {
|
||||
getAddressBook,
|
||||
getSelectedAccount,
|
||||
getTargetAccount,
|
||||
getSelectedAddress,
|
||||
getAveragePriceEstimateInHexWEI,
|
||||
} from '.'
|
||||
import { estimateGasPriceFromRecentBlocks, calcGasTotal } from '../pages/send/send.utils'
|
||||
@ -17,10 +16,6 @@ export function getConversionRate (state) {
|
||||
return state.metamask.conversionRate
|
||||
}
|
||||
|
||||
export function getCurrentCurrency (state) {
|
||||
return state.metamask.currentCurrency
|
||||
}
|
||||
|
||||
export function getNativeCurrency (state) {
|
||||
return state.metamask.nativeCurrency
|
||||
}
|
||||
@ -54,25 +49,17 @@ export function getRecentBlocks (state) {
|
||||
return state.metamask.recentBlocks
|
||||
}
|
||||
|
||||
export function getSelectedIdentity (state) {
|
||||
const selectedAddress = getSelectedAddress(state)
|
||||
const identities = state.metamask.identities
|
||||
|
||||
return identities[selectedAddress]
|
||||
}
|
||||
|
||||
export function getSelectedToken (state) {
|
||||
const tokens = state.metamask.tokens || []
|
||||
const selectedTokenAddress = state.metamask.selectedTokenAddress
|
||||
const selectedToken = tokens.filter(({ address }) => address === selectedTokenAddress)[0]
|
||||
const sendToken = state.metamask.send.token
|
||||
const sendToken = state.metamask?.send.token
|
||||
|
||||
return selectedToken || sendToken || null
|
||||
}
|
||||
|
||||
export function getSelectedTokenContract (state) {
|
||||
const selectedToken = getSelectedToken(state)
|
||||
|
||||
return selectedToken
|
||||
? global.eth.contract(abi).at(selectedToken.address)
|
||||
: null
|
||||
|
@ -7,7 +7,6 @@ import {
|
||||
import {
|
||||
getBlockGasLimit,
|
||||
getConversionRate,
|
||||
getCurrentCurrency,
|
||||
getCurrentNetwork,
|
||||
getNativeCurrency,
|
||||
getGasLimit,
|
||||
@ -15,7 +14,6 @@ import {
|
||||
getGasTotal,
|
||||
getPrimaryCurrency,
|
||||
getRecentBlocks,
|
||||
getSelectedIdentity,
|
||||
getSelectedToken,
|
||||
getSelectedTokenContract,
|
||||
getSendAmount,
|
||||
@ -125,15 +123,6 @@ describe('send selectors', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getCurrentCurrency()', function () {
|
||||
it('should return the currently selected currency', function () {
|
||||
assert.equal(
|
||||
getCurrentCurrency(mockState),
|
||||
'USD'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getNativeCurrency()', function () {
|
||||
it('should return the ticker symbol of the selected network', function () {
|
||||
assert.equal(
|
||||
@ -197,18 +186,6 @@ describe('send selectors', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getSelectedIdentity()', function () {
|
||||
it('should return the identity object of the currently selected address', function () {
|
||||
assert.deepEqual(
|
||||
getSelectedIdentity(mockState),
|
||||
{
|
||||
address: '0xd85a4b6a394794842887b8284293d69163007bbb',
|
||||
name: 'Send Account 4',
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getSelectedToken()', function () {
|
||||
it('should return the currently selected token if selected', function () {
|
||||
assert.deepEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user