aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-utils.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-01 08:54:10 +0800
committerGitHub <noreply@github.com>2017-03-01 08:54:10 +0800
commitf162a11585392df5e593018a02549f8b03018d22 (patch)
treec91dae0c308fb41a461fe85ce4cbeca5b49211df /app/scripts/lib/tx-utils.js
parentab01fef1c0ffddf09a20f90a910e5e068cf8c71e (diff)
parenta600ccd4f863d7a473392fc283f4cec248225a27 (diff)
downloadtangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.gz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.bz2
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.lz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.xz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.zst
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.zip
Merge pull request #1154 from MetaMask/i765-gaslimits
Add ability to customize gas and gasPrice on tx confirmation screen
Diffstat (limited to 'app/scripts/lib/tx-utils.js')
-rw-r--r--app/scripts/lib/tx-utils.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js
index 240a6ab47..19a2d430e 100644
--- a/app/scripts/lib/tx-utils.js
+++ b/app/scripts/lib/tx-utils.js
@@ -92,11 +92,10 @@ module.exports = class txProviderUtils {
}
// builds ethTx from txParams object
- buildEthTxFromParams (txParams, gasMultiplier = 1) {
+ buildEthTxFromParams (txParams) {
// apply gas multiplyer
let gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16)
// multiply and divide by 100 so as to add percision to integer mul
- gasPrice = gasPrice.mul(new BN(gasMultiplier * 100, 10)).div(new BN(100, 10))
txParams.gasPrice = ethUtil.intToHex(gasPrice.toNumber())
// normalize values
txParams.to = normalize(txParams.to)
@@ -106,6 +105,7 @@ module.exports = class txProviderUtils {
txParams.gasLimit = normalize(txParams.gasLimit || txParams.gas)
txParams.nonce = normalize(txParams.nonce)
// build ethTx
+ log.info(`Prepared tx for signing: ${JSON.stringify(txParams)}`)
const ethTx = new Transaction(txParams)
return ethTx
}