aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-03-25 00:45:36 +0800
committerDan Finlay <dan@danfinlay.com>2017-03-25 00:45:36 +0800
commitabe9223a8a7dba874e209d9e94f04c9d87d28ef5 (patch)
treec9afe17d10ff5f30c570ee026bb0a6236b08b04c
parent0e74cf2cba206520dbb8d7cc7b2a989566317201 (diff)
parent9c6391f6e0ac25bab959da54277f726ff40959b7 (diff)
downloadtangerine-wallet-browser-abe9223a8a7dba874e209d9e94f04c9d87d28ef5.tar.gz
tangerine-wallet-browser-abe9223a8a7dba874e209d9e94f04c9d87d28ef5.tar.zst
tangerine-wallet-browser-abe9223a8a7dba874e209d9e94f04c9d87d28ef5.zip
Merge branch 'i1234-HardGasLimits-BrowserForm' of github.com:MetaMask/metamask-plugin into i1234-HardGasLimits-BrowserForm
-rw-r--r--app/scripts/lib/tx-utils.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js
index c6814c05f..7988f83e9 100644
--- a/app/scripts/lib/tx-utils.js
+++ b/app/scripts/lib/tx-utils.js
@@ -63,7 +63,7 @@ module.exports = class txProviderUtils {
const initialGasLimitBn = hexToBn(initialGasLimitHex)
const blockGasLimitBn = hexToBn(blockGasLimitHex)
const bufferedGasLimitBn = initialGasLimitBn.muln(1.5)
-
+
// if initialGasLimit is above blockGasLimit, dont modify it
if (initialGasLimitBn.gt(blockGasLimitBn)) return bnToHex(initialGasLimitBn)
// if bufferedGasLimit is below blockGasLimit, use bufferedGasLimit
@@ -99,7 +99,7 @@ module.exports = class txProviderUtils {
txParams.from = normalize(txParams.from)
txParams.value = normalize(txParams.value)
txParams.data = normalize(txParams.data)
- txParams.gasLimit = normalize(txParams.gasLimit || txParams.gas)
+ txParams.gas = normalize(txParams.gas || txParams.gasLimit)
txParams.nonce = normalize(txParams.nonce)
// build ethTx
log.info(`Prepared tx for signing: ${JSON.stringify(txParams)}`)
@@ -134,4 +134,4 @@ function bnToHex(inputBn) {
function hexToBn(inputHex) {
return new BN(ethUtil.stripHexPrefix(inputHex), 16)
-} \ No newline at end of file
+}