aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSneh Koul <35871990+Sneh1999@users.noreply.github.com>2019-04-12 01:50:03 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-04-12 01:50:03 +0800
commit2786932576a92f8e75ee798d91c8222741c774c9 (patch)
tree964b41c0c798b95bb99daf470649ce0620738c89
parent7ceb1c63ccceeb631c148b9244987dba54f77b12 (diff)
downloadtangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar.gz
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar.bz2
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar.lz
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar.xz
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.tar.zst
tangerine-wallet-browser-2786932576a92f8e75ee798d91c8222741c774c9.zip
repeated getSelectedAddress() func send.selectors.js removed (#6056)
-rw-r--r--ui/app/components/app/send/send.container.js5
-rw-r--r--ui/app/components/app/send/send.selectors.js8
-rw-r--r--ui/app/components/app/send/tests/send-container.test.js5
-rw-r--r--ui/app/components/app/send/tests/send-selectors.test.js9
4 files changed, 9 insertions, 18 deletions
diff --git a/ui/app/components/app/send/send.container.js b/ui/app/components/app/send/send.container.js
index e65463b93..303639c76 100644
--- a/ui/app/components/app/send/send.container.js
+++ b/ui/app/components/app/send/send.container.js
@@ -2,6 +2,10 @@ import { connect } from 'react-redux'
import SendEther from './send.component'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
+const {
+ getSelectedAddress,
+} = require('../../../selectors/selectors')
+
import {
getAmountConversionRate,
getBlockGasLimit,
@@ -12,7 +16,6 @@ import {
getGasTotal,
getPrimaryCurrency,
getRecentBlocks,
- getSelectedAddress,
getSelectedToken,
getSelectedTokenContract,
getSelectedTokenToFiatRate,
diff --git a/ui/app/components/app/send/send.selectors.js b/ui/app/components/app/send/send.selectors.js
index 2ec677ad1..89f047d50 100644
--- a/ui/app/components/app/send/send.selectors.js
+++ b/ui/app/components/app/send/send.selectors.js
@@ -5,6 +5,7 @@ const {
} = require('../../../helpers/utils/conversion-util')
const {
getMetaMaskAccounts,
+ getSelectedAddress,
} = require('../../../selectors/selectors')
const {
estimateGasPriceFromRecentBlocks,
@@ -33,7 +34,6 @@ const selectors = {
getPrimaryCurrency,
getRecentBlocks,
getSelectedAccount,
- getSelectedAddress,
getSelectedIdentity,
getSelectedToken,
getSelectedTokenContract,
@@ -149,12 +149,6 @@ function getSelectedAccount (state) {
return accounts[selectedAddress]
}
-function getSelectedAddress (state) {
- const selectedAddress = state.metamask.selectedAddress || Object.keys(getMetaMaskAccounts(state))[0]
-
- return selectedAddress
-}
-
function getSelectedIdentity (state) {
const selectedAddress = getSelectedAddress(state)
const identities = state.metamask.identities
diff --git a/ui/app/components/app/send/tests/send-container.test.js b/ui/app/components/app/send/tests/send-container.test.js
index 9538b67b3..9d7365ac9 100644
--- a/ui/app/components/app/send/tests/send-container.test.js
+++ b/ui/app/components/app/send/tests/send-container.test.js
@@ -35,7 +35,6 @@ proxyquire('../send.container.js', {
getGasTotal: (s) => `mockGasTotal:${s}`,
getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`,
getRecentBlocks: (s) => `mockRecentBlocks:${s}`,
- getSelectedAddress: (s) => `mockSelectedAddress:${s}`,
getSelectedToken: (s) => `mockSelectedToken:${s}`,
getSelectedTokenContract: (s) => `mockTokenContract:${s}`,
getSelectedTokenToFiatRate: (s) => `mockTokenToFiatRate:${s}`,
@@ -47,11 +46,15 @@ proxyquire('../send.container.js', {
getTokenBalance: (s) => `mockTokenBalance:${s}`,
getQrCodeData: (s) => `mockQrCodeData:${s}`,
},
+ '../../../selectors/selectors': {
+ getSelectedAddress: (s) => `mockSelectedAddress:${s}`,
+ },
'../../../store/actions': actionSpies,
'../../../ducks/send/send.duck': duckActionSpies,
'./send.utils.js': {
calcGasTotal: (gasLimit, gasPrice) => gasLimit + gasPrice,
},
+
})
describe('send container', () => {
diff --git a/ui/app/components/app/send/tests/send-selectors.test.js b/ui/app/components/app/send/tests/send-selectors.test.js
index cdc86fe59..ccc126795 100644
--- a/ui/app/components/app/send/tests/send-selectors.test.js
+++ b/ui/app/components/app/send/tests/send-selectors.test.js
@@ -20,7 +20,6 @@ const {
getPrimaryCurrency,
getRecentBlocks,
getSelectedAccount,
- getSelectedAddress,
getSelectedIdentity,
getSelectedToken,
getSelectedTokenContract,
@@ -274,14 +273,6 @@ describe('send selectors', () => {
})
})
- describe('getSelectedAddress()', () => {
- it('should', () => {
- assert.equal(
- getSelectedAddress(mockState),
- '0xd85a4b6a394794842887b8284293d69163007bbb'
- )
- })
- })
describe('getSelectedIdentity()', () => {
it('should return the identity object of the currently selected address', () => {