aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-28 09:08:04 +0800
committerDan <danjm.com@gmail.com>2018-03-28 09:08:04 +0800
commit8e6ab7df052a5ca43b15edc9c308c626bb23e64c (patch)
treedf9ef6f3952eec8a68fa25d2620d7f248d57693a /ui/app/send-v2.js
parentb6b18339e2de92afd2fb5364ec5bc4c29b4d10a3 (diff)
downloadtangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar
tangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.gz
tangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.bz2
tangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.lz
tangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.xz
tangerine-wallet-browser-8e6ab7df052a5ca43b15edc9c308c626bb23e64c.tar.zst
tangerine-wallet-browser-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.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index 620da73f8..497d0b147 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 },