1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00
This commit is contained in:
Sara Reynolds 2018-06-22 15:05:50 -07:00
parent 9f5ee94b69
commit ad6c454fd5
8 changed files with 9 additions and 24 deletions

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { import {
getConversionRate, getConversionRate,
getConvertedCurrency, getCurrentCurrency,
} from '../send.selectors.js' } from '../send.selectors.js'
import AccountListItem from './account-list-item.component' import AccountListItem from './account-list-item.component'
@ -10,6 +10,6 @@ export default connect(mapStateToProps)(AccountListItem)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
conversionRate: getConversionRate(state), conversionRate: getConversionRate(state),
currentCurrency: getConvertedCurrency(state), currentCurrency: getCurrentCurrency(state),
} }
} }

View File

@ -12,7 +12,7 @@ proxyquire('../account-list-item.container.js', {
}, },
'../send.selectors.js': { '../send.selectors.js': {
getConversionRate: (s) => `mockConversionRate:${s}`, getConversionRate: (s) => `mockConversionRate:${s}`,
getConvertedCurrency: (s) => `mockCurrentCurrency:${s}`, getCurrentCurrency: (s) => `mockCurrentCurrency:${s}`,
}, },
}) })

View File

@ -2,7 +2,7 @@ import { connect } from 'react-redux'
import { import {
getAmountConversionRate, getAmountConversionRate,
getConversionRate, getConversionRate,
getConvertedCurrency, getCurrentCurrency,
getGasTotal, getGasTotal,
getPrimaryCurrency, getPrimaryCurrency,
getSelectedToken, getSelectedToken,
@ -31,7 +31,7 @@ function mapStateToProps (state) {
amountConversionRate: getAmountConversionRate(state), amountConversionRate: getAmountConversionRate(state),
balance: getSendFromBalance(state), balance: getSendFromBalance(state),
conversionRate: getConversionRate(state), conversionRate: getConversionRate(state),
convertedCurrency: getConvertedCurrency(state), convertedCurrency: getCurrentCurrency(state),
gasTotal: getGasTotal(state), gasTotal: getGasTotal(state),
inError: sendAmountIsInError(state), inError: sendAmountIsInError(state),
primaryCurrency: getPrimaryCurrency(state), primaryCurrency: getPrimaryCurrency(state),

View File

@ -24,7 +24,7 @@ proxyquire('../send-amount-row.container.js', {
'../../send.selectors': { '../../send.selectors': {
getAmountConversionRate: (s) => `mockAmountConversionRate:${s}`, getAmountConversionRate: (s) => `mockAmountConversionRate:${s}`,
getConversionRate: (s) => `mockConversionRate:${s}`, getConversionRate: (s) => `mockConversionRate:${s}`,
getConvertedCurrency: (s) => `mockConvertedCurrency:${s}`, getCurrentCurrency: (s) => `mockConvertedCurrency:${s}`,
getGasTotal: (s) => `mockGasTotal:${s}`, getGasTotal: (s) => `mockGasTotal:${s}`,
getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`, getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`,
getSelectedToken: (s) => `mockSelectedToken:${s}`, getSelectedToken: (s) => `mockSelectedToken:${s}`,

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { import {
getConversionRate, getConversionRate,
getConvertedCurrency, getCurrentCurrency,
getGasTotal, getGasTotal,
} from '../../send.selectors.js' } from '../../send.selectors.js'
import { sendGasIsInError } from './send-gas-row.selectors.js' import { sendGasIsInError } from './send-gas-row.selectors.js'
@ -13,7 +13,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(SendGasRow)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
conversionRate: getConversionRate(state), conversionRate: getConversionRate(state),
convertedCurrency: getConvertedCurrency(state), convertedCurrency: getCurrentCurrency(state),
gasTotal: getGasTotal(state), gasTotal: getGasTotal(state),
gasLoadingError: sendGasIsInError(state), gasLoadingError: sendGasIsInError(state),
} }

View File

@ -19,7 +19,7 @@ proxyquire('../send-gas-row.container.js', {
}, },
'../../send.selectors.js': { '../../send.selectors.js': {
getConversionRate: (s) => `mockConversionRate:${s}`, getConversionRate: (s) => `mockConversionRate:${s}`,
getConvertedCurrency: (s) => `mockConvertedCurrency:${s}`, getCurrentCurrency: (s) => `mockConvertedCurrency:${s}`,
getGasTotal: (s) => `mockGasTotal:${s}`, getGasTotal: (s) => `mockGasTotal:${s}`,
}, },
'./send-gas-row.selectors.js': { sendGasIsInError: (s) => `mockGasLoadingError:${s}` }, './send-gas-row.selectors.js': { sendGasIsInError: (s) => `mockGasLoadingError:${s}` },

View File

@ -14,7 +14,6 @@ const selectors = {
getAmountConversionRate, getAmountConversionRate,
getBlockGasLimit, getBlockGasLimit,
getConversionRate, getConversionRate,
getConvertedCurrency,
getCurrentAccountWithSendEtherInfo, getCurrentAccountWithSendEtherInfo,
getCurrentCurrency, getCurrentCurrency,
getCurrentNetwork, getCurrentNetwork,
@ -98,10 +97,6 @@ function getConversionRate (state) {
return state.metamask.conversionRate return state.metamask.conversionRate
} }
function getConvertedCurrency (state) {
return state.metamask.currentCurrency
}
function getCurrentAccountWithSendEtherInfo (state) { function getCurrentAccountWithSendEtherInfo (state) {
const currentAddress = getSelectedAddress(state) const currentAddress = getSelectedAddress(state)
const accounts = accountsWithSendEtherInfoSelector(state) const accounts = accountsWithSendEtherInfoSelector(state)

View File

@ -8,7 +8,6 @@ const {
getBlockGasLimit, getBlockGasLimit,
getAmountConversionRate, getAmountConversionRate,
getConversionRate, getConversionRate,
getConvertedCurrency,
getCurrentAccountWithSendEtherInfo, getCurrentAccountWithSendEtherInfo,
getCurrentCurrency, getCurrentCurrency,
getCurrentNetwork, getCurrentNetwork,
@ -154,15 +153,6 @@ describe('send selectors', () => {
}) })
}) })
describe('getConvertedCurrency()', () => {
it('should return the currently selected currency', () => {
assert.equal(
getConvertedCurrency(mockState),
'USD'
)
})
})
describe('getCurrentAccountWithSendEtherInfo()', () => { describe('getCurrentAccountWithSendEtherInfo()', () => {
it('should return the currently selected account with identity info', () => { it('should return the currently selected account with identity info', () => {
assert.deepEqual( assert.deepEqual(