diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-03-01 06:08:00 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-03-01 06:08:00 +0800 |
commit | da88481560f0f2ad7e12b3e94082aa10147b900e (patch) | |
tree | d90c02a55451768807babb49ef95519d44f93e1c /app/scripts/transaction-manager.js | |
parent | 5a74c0fcad92cf4192eefedcb092d4525157902f (diff) | |
download | tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.gz tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.zst tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.zip |
Remove gasMultiplier txMeta param
This was used by the custom gas slider on the `send` screen, and it was used to modify the gas value before sending it out, breaking our new custom gas field logic.
Removed it and the logic that referred to this now-outdated parameter.
Diffstat (limited to 'app/scripts/transaction-manager.js')
-rw-r--r-- | app/scripts/transaction-manager.js | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index eaeee2d72..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,10 +137,8 @@ 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) @@ -210,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())) |