1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

Move send selectors to selectors dir (#8505)

This commit is contained in:
Erik Marks 2020-05-04 11:27:14 -07:00 committed by GitHub
parent 5b06bf795b
commit eacdb5d920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 40 additions and 40 deletions

View File

@ -46,7 +46,7 @@ import {
import {
getTokenBalance,
getSendMaxModeState,
} from '../../../../pages/send/send.selectors'
} from '../../../../selectors/send'
import {
formatCurrency,
} from '../../../../helpers/utils/confirm-tx.util'

View File

@ -46,7 +46,7 @@ proxyquire('../gas-modal-page-container.container.js', {
'../../../../ducks/gas/gas.duck': gasActionSpies,
'../../../../ducks/confirm-transaction/confirm-transaction.duck': confirmTransactionActionSpies,
'../../../../ducks/send/send.duck': sendActionSpies,
'../../../../pages/send/send.selectors': {
'../../../../selectors/send': {
getTokenBalance: (state) => state.metamask.send.tokenBalance || '0x0',
},
})

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux'
import CurrencyInput from './currency-input.component'
import { ETH } from '../../../helpers/constants/common'
import { getSendMaxModeState } from '../../../pages/send/send.selectors'
import { getSendMaxModeState } from '../../../selectors/send'
import { getIsMainnet, preferencesSelector } from '../../../selectors'
const mapStateToProps = (state) => {

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux'
import {
getNativeCurrency,
} from '../send.selectors.js'
} from '../../../selectors/send'
import {
getIsMainnet,
isBalanceCached,

View File

@ -10,7 +10,7 @@ proxyquire('../account-list-item.container.js', {
return () => ({})
},
},
'../send.selectors.js': {
'../../../selectors/send': {
getConversionRate: () => `mockConversionRate`,
getCurrentCurrency: () => `mockCurrentCurrency`,
getNativeCurrency: () => `mockNativeCurrency`,

View File

@ -2,7 +2,7 @@ import { connect } from 'react-redux'
import {
getSendEnsResolution,
getSendEnsResolutionError,
} from '../../send.selectors.js'
} from '../../../../selectors/send'
import {
accountsWithSendEtherInfoSelector,
getAddressBook,

View File

@ -3,7 +3,7 @@ import {
getCurrentNetwork,
getSendTo,
getSendToNickname,
} from '../../send.selectors'
} from '../../../../selectors/send'
import {
getAddressBookEntry,
} from '../../../../selectors'

View File

@ -17,7 +17,7 @@ proxyquire('../add-recipient.container.js', {
return () => ({})
},
},
'../../send.selectors.js': {
'../../../../selectors/send': {
getSendEnsResolution: (s) => `mockSendEnsResolution:${s}`,
getSendEnsResolutionError: (s) => `mockSendEnsResolutionError:${s}`,
},

View File

@ -5,7 +5,7 @@ import {
getSendFromBalance,
getTokenBalance,
getSendMaxModeState,
} from '../../../send.selectors.js'
} from '../../../../../selectors/send'
import { getBasicGasEstimateLoadingStatus } from '../../../../../selectors'
import { calcMaxAmount } from './amount-max-button.utils.js'
import {

View File

@ -21,7 +21,7 @@ proxyquire('../amount-max-button.container.js', {
return () => ({})
},
},
'../../../send.selectors.js': {
'../../../../../selectors/send': {
getGasTotal: (s) => `mockGasTotal:${s}`,
getSelectedToken: (s) => `mockSelectedToken:${s}`,
getSendFromBalance: (s) => `mockBalance:${s}`,

View File

@ -9,7 +9,7 @@ import {
getTokenBalance,
getSendMaxModeState,
sendAmountIsInError,
} from '../../send.selectors'
} from '../../../../selectors/send'
import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils'
import {
setMaxModeTo,

View File

@ -19,7 +19,7 @@ proxyquire('../send-amount-row.container.js', {
return () => ({})
},
},
'../../send.selectors': { sendAmountIsInError: (s) => `mockInError:${s}` },
'../../../../selectors/send': { sendAmountIsInError: (s) => `mockInError:${s}` },
'../../send.utils': {
getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }),
getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }),

View File

@ -2,7 +2,7 @@ import { connect } from 'react-redux'
import SendContent from './send-content.component'
import {
getSendTo,
} from '../send.selectors'
} from '../../../selectors/send'
import {
accountsWithSendEtherInfoSelector,
getAddressBookEntry,

View File

@ -11,7 +11,15 @@ import {
getGasLoadingError,
gasFeeIsInError,
getGasButtonGroupShown,
} from '../../send.selectors.js'
} from '../../../../selectors/send'
import {
getAdvancedInlineGasShown,
getCurrentEthBalance,
getSelectedToken,
getBasicGasEstimateLoadingStatus,
getRenderableEstimateDataForSmallButtonsFromGWEI,
getDefaultActiveButtonIndex,
} from '../../../../selectors'
import {
isBalanceSufficient,
calcGasTotal,
@ -27,14 +35,6 @@ import {
setCustomGasLimit,
} from '../../../../ducks/gas/gas.duck'
import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '../../../../store/actions'
import {
getAdvancedInlineGasShown,
getCurrentEthBalance,
getSelectedToken,
getBasicGasEstimateLoadingStatus,
getRenderableEstimateDataForSmallButtonsFromGWEI,
getDefaultActiveButtonIndex,
} from '../../../../selectors'
import SendGasRow from './send-gas-row.component'

View File

@ -30,7 +30,7 @@ proxyquire('../send-gas-row.container.js', {
return () => ({})
},
},
'../../send.selectors.js': {
'../../../../selectors/send': {
getSendMaxModeState: (s) => `mockMaxModeOn:${s}`,
},
'../../send.utils.js': {

View File

@ -1,5 +1,5 @@
import { connect } from 'react-redux'
import { getSendErrors } from '../../../send.selectors'
import { getSendErrors } from '../../../../../selectors/send'
import SendRowErrorMessage from './send-row-error-message.component'
export default connect(mapStateToProps)(SendRowErrorMessage)

View File

@ -10,7 +10,7 @@ proxyquire('../send-row-error-message.container.js', {
return () => ({})
},
},
'../../../send.selectors': { getSendErrors: (s) => `mockErrors:${s}` },
'../../../../../selectors/send': { getSendErrors: (s) => `mockErrors:${s}` },
})
describe('send-row-error-message container', function () {

View File

@ -23,17 +23,17 @@ import {
getUnapprovedTxs,
getSendErrors,
isSendFormInError,
} from '../send.selectors'
import {
addressIsNew,
constructTxParams,
constructUpdatedTx,
} from './send-footer.utils'
} from '../../../selectors/send'
import {
getGasIsLoading,
getRenderableEstimateDataForSmallButtonsFromGWEI,
getDefaultActiveButtonIndex,
} from '../../../selectors'
import {
addressIsNew,
constructTxParams,
constructUpdatedTx,
} from './send-footer.utils'
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter)

View File

@ -27,7 +27,7 @@ proxyquire('../send-footer.container.js', {
},
},
'../../../store/actions': actionSpies,
'../send.selectors': {
'../../../selectors/send': {
getGasLimit: (s) => `mockGasLimit:${s}`,
getGasPrice: (s) => `mockGasPrice:${s}`,
getGasTotal: (s) => `mockGasTotal:${s}`,

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux'
import { clearSend } from '../../../store/actions'
import SendHeader from './send-header.component'
import { getTitleKey } from '../send.selectors'
import { getTitleKey } from '../../../selectors/send'
export default connect(mapStateToProps, mapDispatchToProps)(SendHeader)

View File

@ -18,7 +18,7 @@ proxyquire('../send-header.container.js', {
},
},
'../../../store/actions': actionSpies,
'../send.selectors': {
'../../../selectors/send': {
getTitleKey: (s) => `mockTitleKey:${s}`,
},
})

View File

@ -23,7 +23,7 @@ import {
getTokenBalance,
getQrCodeData,
getTokens,
} from './send.selectors'
} from '../../selectors/send'
import {
getSelectedAddress,
getAddressBook,

View File

@ -5,7 +5,7 @@ import { withRouter } from 'react-router-dom'
import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../store/actions'
import {
getQrCodeData,
} from '../../../send/send.selectors'
} from '../../../../selectors/send'
const mapStateToProps = (state) => {
return {

View File

@ -6,8 +6,8 @@ import {
getTargetAccount,
getSelectedAddress,
getAveragePriceEstimateInHexWEI,
} from '../../selectors'
import { estimateGasPriceFromRecentBlocks, calcGasTotal } from './send.utils'
} from '.'
import { estimateGasPriceFromRecentBlocks, calcGasTotal } from '../pages/send/send.utils'
export function getBlockGasLimit (state) {
return state.metamask.currentBlockGasLimit

View File

@ -3,7 +3,7 @@ import sinon from 'sinon'
import {
accountsWithSendEtherInfoSelector,
getCurrentAccountWithSendEtherInfo,
} from '../../../selectors'
} from '..'
import {
getBlockGasLimit,
getConversionRate,
@ -37,7 +37,7 @@ import {
getTokens,
getTitleKey,
isSendFormInError,
} from '../send.selectors.js'
} from '../send'
import mockState from './send-selectors-test-data'
describe('send selectors', function () {