aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-03 16:03:31 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-03 16:03:31 +0800
commit35875863d2feafc1f653e17e0f58efc2f18ddc46 (patch)
tree5d40581a08201b3f37c7b31fe2aab4675d827f6b /ui/app/send-v2.js
parent516c1869b0f366a42282a66e14185ce630f883dd (diff)
parentc14ec4191741c444dcf5b7c3e177c17a10374c16 (diff)
downloadtangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.gz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.bz2
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.lz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.xz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.zst
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.zip
Fix merge conflicts. Modify send workflow
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r--ui/app/send-v2.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index abbb97643..b4d38495d 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')
const { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } = require('./routes')
@@ -133,7 +134,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 })
})
@@ -141,19 +142,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 },
@@ -642,6 +635,10 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
txParams.to = to
}
+ Object.keys(txParams).forEach(key => {
+ txParams[key] = ethUtil.addHexPrefix(txParams[key])
+ })
+
selectedToken
? signTokenTx(selectedToken.address, to, amount, txParams)
: signTx(txParams)