diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-12-12 22:54:03 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-12 23:30:57 +0800 |
commit | 1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d (patch) | |
tree | 8d5e4f3f8b316a6912d987e98dee0919b20f083d /ui/app/selectors | |
parent | 9c2401965911aa78496a8168a76e9c0c2e4c86b5 (diff) | |
download | tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar.gz tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar.bz2 tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar.lz tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar.xz tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.tar.zst tangerine-wallet-browser-1145a0a9ad46fda5fb9a7ad9cf5cf062c574691d.zip |
Ensures that advanced tab gas limit reflects tx gas limit
Diffstat (limited to 'ui/app/selectors')
-rw-r--r-- | ui/app/selectors/custom-gas.js | 5 | ||||
-rw-r--r-- | ui/app/selectors/tests/custom-gas.test.js | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index 91c9109a5..f9cedf9fb 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -221,11 +221,10 @@ function getGasPriceInHexWei (price) { )(price) } -function getRenderableBasicEstimateData (state) { +function getRenderableBasicEstimateData (state, gasLimit) { if (getBasicGasEstimateLoadingStatus(state)) { return [] } - const gasLimit = state.metamask.send.gasLimit || getCustomGasLimit(state) const conversionRate = state.metamask.conversionRate const currentCurrency = getCurrentCurrency(state) const { @@ -270,7 +269,7 @@ function getRenderableEstimateDataForSmallButtonsFromGWEI (state) { if (getBasicGasEstimateLoadingStatus(state)) { return [] } - const gasLimit = state.metamask.send.gasLimit || getCustomGasLimit(state) + const gasLimit = state.metamask.send.gasLimit || getCustomGasLimit(state) || '0x5208' const conversionRate = state.metamask.conversionRate const currentCurrency = getCurrentCurrency(state) const { diff --git a/ui/app/selectors/tests/custom-gas.test.js b/ui/app/selectors/tests/custom-gas.test.js index ebc300160..e43fd0d74 100644 --- a/ui/app/selectors/tests/custom-gas.test.js +++ b/ui/app/selectors/tests/custom-gas.test.js @@ -102,9 +102,6 @@ describe('custom-gas selectors', () => { metamask: { conversionRate: 255.71, currentCurrency: 'usd', - send: { - gasLimit: '0x5208', - }, }, gas: { basicEstimates: { @@ -168,7 +165,7 @@ describe('custom-gas selectors', () => { it('should return renderable data about basic estimates', () => { tests.forEach(test => { assert.deepEqual( - getRenderableBasicEstimateData(test.mockState), + getRenderableBasicEstimateData(test.mockState, '0x5208'), test.expectedResult ) }) |