aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/transaction-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/transaction-manager.js')
-rw-r--r--app/scripts/transaction-manager.js15
1 files changed, 2 insertions, 13 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index 6299091f2..07c90af7e 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -13,7 +13,6 @@ module.exports = class TransactionManager extends EventEmitter {
super()
this.store = new ObservableStore(extend({
transactions: [],
- gasMultiplier: 1,
}, opts.initState))
this.memStore = new ObservableStore({})
this.networkStore = opts.networkStore || new ObservableStore({})
@@ -52,14 +51,6 @@ module.exports = class TransactionManager extends EventEmitter {
return fullTxList.filter(txMeta => txMeta.metamaskNetworkId === network)
}
- getGasMultiplier () {
- return this.store.getState().gasMultiplier
- }
-
- setGasMultiplier (gasMultiplier) {
- return this.store.updateState({ gasMultiplier })
- }
-
// Adds a tx to the txlist
addTx (txMeta) {
var txList = this.getTxList()
@@ -129,7 +120,6 @@ module.exports = class TransactionManager extends EventEmitter {
id: txId,
time: time,
status: 'unapproved',
- gasMultiplier: this.getGasMultiplier(),
metamaskNetworkId: this.getNetwork(),
txParams: txParams,
}
@@ -147,16 +137,15 @@ module.exports = class TransactionManager extends EventEmitter {
setMaxTxCostAndFee (txMeta) {
var txParams = txMeta.txParams
- var gasMultiplier = txMeta.gasMultiplier
var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txMeta.estimatedGas), 16)
var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16)
- gasPrice = gasPrice.mul(new BN(gasMultiplier * 100), 10).div(new BN(100, 10))
var txFee = gasCost.mul(gasPrice)
var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16)
var maxCost = txValue.add(txFee)
txMeta.txFee = txFee
txMeta.txValue = txValue
txMeta.maxCost = maxCost
+ txMeta.gasPrice = gasPrice
this.updateTx(txMeta)
}
@@ -209,7 +198,7 @@ module.exports = class TransactionManager extends EventEmitter {
let txMeta = this.getTx(txId)
let txParams = txMeta.txParams
let fromAddress = txParams.from
- let ethTx = this.txProviderUtils.buildEthTxFromParams(txParams, txMeta.gasMultiplier)
+ let ethTx = this.txProviderUtils.buildEthTxFromParams(txParams)
this.signEthTx(ethTx, fromAddress).then(() => {
this.setTxStatusSigned(txMeta.id)
cb(null, ethUtil.bufferToHex(ethTx.serialize()))