aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/config-manager.js12
-rw-r--r--app/scripts/lib/id-management.js9
-rw-r--r--app/scripts/lib/idStore.js1
-rw-r--r--app/scripts/lib/tx-utils.js4
4 files changed, 4 insertions, 22 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index ea5e49b19..6868637e5 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -228,18 +228,6 @@ ConfigManager.prototype._emitUpdates = function (state) {
})
}
-ConfigManager.prototype.getGasMultiplier = function () {
- var data = this.getData()
- return data.gasMultiplier
-}
-
-ConfigManager.prototype.setGasMultiplier = function (gasMultiplier) {
- var data = this.getData()
-
- data.gasMultiplier = gasMultiplier
- this.setData(data)
-}
-
ConfigManager.prototype.setLostAccounts = function (lostAccounts) {
var data = this.getData()
data.lostAccounts = lostAccounts
diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js
index 421f2105f..90b3fdb13 100644
--- a/app/scripts/lib/id-management.js
+++ b/app/scripts/lib/id-management.js
@@ -7,7 +7,6 @@
*/
const ethUtil = require('ethereumjs-util')
-const BN = ethUtil.BN
const Transaction = require('ethereumjs-tx')
module.exports = IdManagement
@@ -25,13 +24,9 @@ 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
+ // normalize values
+ txParams.gasPrice = ethUtil.intToHex(txParams.gasPrice)
txParams.to = ethUtil.addHexPrefix(txParams.to)
txParams.from = ethUtil.addHexPrefix(txParams.from.toLowerCase())
txParams.value = ethUtil.addHexPrefix(txParams.value)
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 7a6968c6c..01474035e 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -95,7 +95,6 @@ IdentityStore.prototype.getState = function () {
isUnlocked: this._isUnlocked(),
seedWords: seedWords,
selectedAddress: configManager.getSelectedAccount(),
- gasMultiplier: configManager.getGasMultiplier(),
}))
}
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
}