Merge pull request #4687 from snreynolds/i4623-getConvertedCurrency

fixes #4623
feature/default_network_editable
Dan J Miller 7 years ago committed by GitHub
commit b2e64f24ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/app/components/send_/account-list-item/account-list-item.container.js
  2. 2
      ui/app/components/send_/account-list-item/tests/account-list-item-container.test.js
  3. 4
      ui/app/components/send_/send-content/send-amount-row/send-amount-row.container.js
  4. 2
      ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js
  5. 4
      ui/app/components/send_/send-content/send-gas-row/send-gas-row.container.js
  6. 2
      ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-container.test.js
  7. 5
      ui/app/components/send_/send.selectors.js
  8. 10
      ui/app/components/send_/tests/send-selectors.test.js

@ -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),
} }
} }

@ -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}`,
}, },
}) })

@ -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),

@ -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}`,

@ -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),
} }

@ -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}` },

@ -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)

@ -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(

Loading…
Cancel
Save