diff options
author | Dan J Miller <danjm.com@gmail.com> | 2019-02-26 02:16:23 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-26 02:16:23 +0800 |
commit | fdc7eb211340b3af035a7f7c023155a8f1b1675d (patch) | |
tree | a36305155083d8762043bb34bb8d7ea188a75b0e /ui/app/components/send/send-content/send-gas-row | |
parent | 65bfdeedc77e51dea28ef643b5ea9d50a8569c81 (diff) | |
download | tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar.gz tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar.bz2 tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar.lz tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar.xz tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.tar.zst tangerine-wallet-browser-fdc7eb211340b3af035a7f7c023155a8f1b1675d.zip |
Fix gas estimation when sending to contracts (#6195)
* Fix gas estimation when sending to contracts
* Fix calculating of balance sufficiency and tx params when sending token transaction
Diffstat (limited to 'ui/app/components/send/send-content/send-gas-row')
-rw-r--r-- | ui/app/components/send/send-content/send-gas-row/send-gas-row.container.js | 4 | ||||
-rw-r--r-- | ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-container.test.js | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ui/app/components/send/send-content/send-gas-row/send-gas-row.container.js b/ui/app/components/send/send-content/send-gas-row/send-gas-row.container.js index 50cb47178..a187d61a2 100644 --- a/ui/app/components/send/send-content/send-gas-row/send-gas-row.container.js +++ b/ui/app/components/send/send-content/send-gas-row/send-gas-row.container.js @@ -26,7 +26,7 @@ import { } from '../../../../ducks/gas.duck' import { getGasLoadingError, gasFeeIsInError, getGasButtonGroupShown } from './send-gas-row.selectors.js' import { showModal, setGasPrice, setGasLimit, setGasTotal } from '../../../../actions' -import { getAdvancedInlineGasShown, getCurrentEthBalance } from '../../../../selectors' +import { getAdvancedInlineGasShown, getCurrentEthBalance, getSelectedToken } from '../../../../selectors' import SendGasRow from './send-gas-row.component' export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(SendGasRow) @@ -42,7 +42,7 @@ function mapStateToProps (state) { const balance = getCurrentEthBalance(state) const insufficientBalance = !isBalanceSufficient({ - amount: getSendAmount(state), + amount: getSelectedToken(state) ? '0x0' : getSendAmount(state), gasTotal, balance, conversionRate, diff --git a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-container.test.js b/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-container.test.js index 723c406f7..12e78657b 100644 --- a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-container.test.js +++ b/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-container.test.js @@ -35,6 +35,7 @@ proxyquire('../send-gas-row.container.js', { '../../../../selectors': { getCurrentEthBalance: (s) => `mockCurrentEthBalance:${s}`, getAdvancedInlineGasShown: (s) => `mockAdvancedInlineGasShown:${s}`, + getSelectedToken: () => false, }, '../../send.selectors.js': { getConversionRate: (s) => `mockConversionRate:${s}`, |