mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
Merge pull request #4687 from snreynolds/i4623-getConvertedCurrency
fixes #4623
This commit is contained in:
commit
b2e64f24ec
@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux'
|
||||
import {
|
||||
getConversionRate,
|
||||
getConvertedCurrency,
|
||||
getCurrentCurrency,
|
||||
} from '../send.selectors.js'
|
||||
import AccountListItem from './account-list-item.component'
|
||||
|
||||
@ -10,6 +10,6 @@ export default connect(mapStateToProps)(AccountListItem)
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
conversionRate: getConversionRate(state),
|
||||
currentCurrency: getConvertedCurrency(state),
|
||||
currentCurrency: getCurrentCurrency(state),
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ proxyquire('../account-list-item.container.js', {
|
||||
},
|
||||
'../send.selectors.js': {
|
||||
getConversionRate: (s) => `mockConversionRate:${s}`,
|
||||
getConvertedCurrency: (s) => `mockCurrentCurrency:${s}`,
|
||||
getCurrentCurrency: (s) => `mockCurrentCurrency:${s}`,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { connect } from 'react-redux'
|
||||
import {
|
||||
getAmountConversionRate,
|
||||
getConversionRate,
|
||||
getConvertedCurrency,
|
||||
getCurrentCurrency,
|
||||
getGasTotal,
|
||||
getPrimaryCurrency,
|
||||
getSelectedToken,
|
||||
@ -31,7 +31,7 @@ function mapStateToProps (state) {
|
||||
amountConversionRate: getAmountConversionRate(state),
|
||||
balance: getSendFromBalance(state),
|
||||
conversionRate: getConversionRate(state),
|
||||
convertedCurrency: getConvertedCurrency(state),
|
||||
convertedCurrency: getCurrentCurrency(state),
|
||||
gasTotal: getGasTotal(state),
|
||||
inError: sendAmountIsInError(state),
|
||||
primaryCurrency: getPrimaryCurrency(state),
|
||||
|
@ -24,7 +24,7 @@ proxyquire('../send-amount-row.container.js', {
|
||||
'../../send.selectors': {
|
||||
getAmountConversionRate: (s) => `mockAmountConversionRate:${s}`,
|
||||
getConversionRate: (s) => `mockConversionRate:${s}`,
|
||||
getConvertedCurrency: (s) => `mockConvertedCurrency:${s}`,
|
||||
getCurrentCurrency: (s) => `mockConvertedCurrency:${s}`,
|
||||
getGasTotal: (s) => `mockGasTotal:${s}`,
|
||||
getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`,
|
||||
getSelectedToken: (s) => `mockSelectedToken:${s}`,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux'
|
||||
import {
|
||||
getConversionRate,
|
||||
getConvertedCurrency,
|
||||
getCurrentCurrency,
|
||||
getGasTotal,
|
||||
} from '../../send.selectors.js'
|
||||
import { sendGasIsInError } from './send-gas-row.selectors.js'
|
||||
@ -13,7 +13,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(SendGasRow)
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
conversionRate: getConversionRate(state),
|
||||
convertedCurrency: getConvertedCurrency(state),
|
||||
convertedCurrency: getCurrentCurrency(state),
|
||||
gasTotal: getGasTotal(state),
|
||||
gasLoadingError: sendGasIsInError(state),
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ proxyquire('../send-gas-row.container.js', {
|
||||
},
|
||||
'../../send.selectors.js': {
|
||||
getConversionRate: (s) => `mockConversionRate:${s}`,
|
||||
getConvertedCurrency: (s) => `mockConvertedCurrency:${s}`,
|
||||
getCurrentCurrency: (s) => `mockConvertedCurrency:${s}`,
|
||||
getGasTotal: (s) => `mockGasTotal:${s}`,
|
||||
},
|
||||
'./send-gas-row.selectors.js': { sendGasIsInError: (s) => `mockGasLoadingError:${s}` },
|
||||
|
@ -14,7 +14,6 @@ const selectors = {
|
||||
getAmountConversionRate,
|
||||
getBlockGasLimit,
|
||||
getConversionRate,
|
||||
getConvertedCurrency,
|
||||
getCurrentAccountWithSendEtherInfo,
|
||||
getCurrentCurrency,
|
||||
getCurrentNetwork,
|
||||
@ -98,10 +97,6 @@ function getConversionRate (state) {
|
||||
return state.metamask.conversionRate
|
||||
}
|
||||
|
||||
function getConvertedCurrency (state) {
|
||||
return state.metamask.currentCurrency
|
||||
}
|
||||
|
||||
function getCurrentAccountWithSendEtherInfo (state) {
|
||||
const currentAddress = getSelectedAddress(state)
|
||||
const accounts = accountsWithSendEtherInfoSelector(state)
|
||||
|
@ -8,7 +8,6 @@ const {
|
||||
getBlockGasLimit,
|
||||
getAmountConversionRate,
|
||||
getConversionRate,
|
||||
getConvertedCurrency,
|
||||
getCurrentAccountWithSendEtherInfo,
|
||||
getCurrentCurrency,
|
||||
getCurrentNetwork,
|
||||
@ -154,15 +153,6 @@ describe('send selectors', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getConvertedCurrency()', () => {
|
||||
it('should return the currently selected currency', () => {
|
||||
assert.equal(
|
||||
getConvertedCurrency(mockState),
|
||||
'USD'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getCurrentAccountWithSendEtherInfo()', () => {
|
||||
it('should return the currently selected account with identity info', () => {
|
||||
assert.deepEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user