aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/id-management.js
diff options
context:
space:
mode:
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 e250943a0..299998cee 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 = txParams.gasMultiplier || 1
+ delete txParams.gasMultiplier
+ var gasPrice = parseFloat(new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16).toString()) * gasMultiplier
+ txParams.gasPrice = ethUtil.intToHex(parseInt(gasPrice))
// normalize values
+
txParams.to = ethUtil.addHexPrefix(txParams.to)
txParams.from = ethUtil.addHexPrefix(txParams.from)
txParams.value = ethUtil.addHexPrefix(txParams.value)