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/lib | |
parent | 5a74c0fcad92cf4192eefedcb092d4525157902f (diff) | |
download | tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.gz tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.bz2 tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.lz tangerine-wallet-browser-da88481560f0f2ad7e12b3e94082aa10147b900e.tar.xz 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/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 12 | ||||
-rw-r--r-- | app/scripts/lib/id-management.js | 8 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 1 | ||||
-rw-r--r-- | app/scripts/lib/tx-utils.js | 3 |
4 files changed, 3 insertions, 21 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..30631d479 100644 --- a/app/scripts/lib/id-management.js +++ b/app/scripts/lib/id-management.js @@ -25,13 +25,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 b152effcc..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) |