diff options
author | Dan <danjm.com@gmail.com> | 2018-03-28 09:08:04 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-28 09:08:04 +0800 |
commit | 8e6ab7df052a5ca43b15edc9c308c626bb23e64c (patch) | |
tree | df9ef6f3952eec8a68fa25d2620d7f248d57693a /ui/app/send-v2.js | |
parent | b6b18339e2de92afd2fb5364ec5bc4c29b4d10a3 (diff) | |
download | dexon-wallet-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.gz dexon-wallet-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.zst dexon-wallet-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.zip |
Checking for sufficient balance in confirm ether screen; includes error messages for user.
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r-- | ui/app/send-v2.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index 620da73f..497d0b14 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -27,6 +27,7 @@ const { const { isBalanceSufficient, isTokenBalanceSufficient, + getGasTotal, } = require('./components/send/send-utils') const { isValidAddress } = require('./util') @@ -128,7 +129,7 @@ SendTransactionScreen.prototype.updateGas = function () { estimateGas(estimateGasParams), ]) .then(([gasPrice, gas]) => { - const newGasTotal = this.getGasTotal(gas, gasPrice) + const newGasTotal = getGasTotal(gas, gasPrice) updateGasTotal(newGasTotal) this.setState({ gasLoadingError: false }) }) @@ -136,19 +137,11 @@ SendTransactionScreen.prototype.updateGas = function () { this.setState({ gasLoadingError: true }) }) } else { - const newGasTotal = this.getGasTotal(gasLimit, gasPrice) + const newGasTotal = getGasTotal(gasLimit, gasPrice) updateGasTotal(newGasTotal) } } -SendTransactionScreen.prototype.getGasTotal = function (gasLimit, gasPrice) { - return multiplyCurrencies(gasLimit, gasPrice, { - toNumericBase: 'hex', - multiplicandBase: 16, - multiplierBase: 16, - }) -} - SendTransactionScreen.prototype.componentDidUpdate = function (prevProps) { const { from: { balance }, |