aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/id-management.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
commit331bb735c7e9db0aa3af66e4a994e6eb9762af81 (patch)
tree6d51948907cbfc0c002bfdc4698ec99fe100e831 /app/scripts/lib/id-management.js
parent94f25543691b1a26f1b33a9074ba65cb722eff48 (diff)
parent12698b946221c1145d1fe966406adb7265e6b9d2 (diff)
downloadtangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.gz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.bz2
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.lz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.xz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.zst
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.zip
Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault
Diffstat (limited to 'app/scripts/lib/id-management.js')
-rw-r--r--app/scripts/lib/id-management.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js
index 2d42e1e30..421f2105f 100644
--- a/app/scripts/lib/id-management.js
+++ b/app/scripts/lib/id-management.js
@@ -7,6 +7,7 @@
*/
const ethUtil = require('ethereumjs-util')
+const BN = ethUtil.BN
const Transaction = require('ethereumjs-tx')
module.exports = IdManagement
@@ -24,7 +25,13 @@ function IdManagement (opts) {
}
this.signTx = function (txParams) {
+ // calculate gas with custom gas multiplier
+ var gasMultiplier = this.configManager.getGasMultiplier() || 1
+ var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16)
+ gasPrice = gasPrice.mul(new BN(gasMultiplier * 100, 10)).div(new BN(100, 10))
+ txParams.gasPrice = ethUtil.intToHex(gasPrice.toNumber())
// normalize values
+
txParams.to = ethUtil.addHexPrefix(txParams.to)
txParams.from = ethUtil.addHexPrefix(txParams.from.toLowerCase())
txParams.value = ethUtil.addHexPrefix(txParams.value)