diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-10 08:42:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-10 08:42:10 +0800 |
commit | 3775a4bf799efc99cfe3d46b35fc0b39a82c94c2 (patch) | |
tree | 961cea67ce555a778d13f2acd789f05109fe0c84 | |
parent | ebcdb7a4917dae38080b5e73b2ebcf77b7537479 (diff) | |
parent | e2b2083df03b3bd808193ed38536d07ba155ff58 (diff) | |
download | tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar.gz tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar.bz2 tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar.lz tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar.xz tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.tar.zst tangerine-wallet-browser-3775a4bf799efc99cfe3d46b35fc0b39a82c94c2.zip |
Merge pull request #801 from MetaMask/deadly
Properly implement 20% gas bump
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 1 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 1 | ||||
-rw-r--r-- | ui/app/actions.js | 23 | ||||
-rw-r--r-- | ui/app/components/coinbase-form.js | 4 | ||||
-rw-r--r-- | ui/app/components/shapeshift-form.js | 2 |
6 files changed, 14 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a6015ccb3..d0dbb5706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Current Master +- Fix bug where 20% of gas estimate was not being added properly. ## 2.13.7 2016-11-8 diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 0ce91f471..dd895a6c0 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -262,6 +262,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone query.estimateGas(txParams, function(err, result){ if (err) return cb(err) txData.estimatedGas = self.addGasBuffer(result) + txData.txParams.gasLimit = txData.estimatedGas cb() }) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 8b593d820..da05e5f5d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -215,7 +215,6 @@ module.exports = class MetamaskController { let err = this.enforceTxValidations(txParams) if (err) return onTxDoneCb(err) - idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => { if (err) return onTxDoneCb(err) this.sendUpdate() diff --git a/ui/app/actions.js b/ui/app/actions.js index 1f0d8fc78..3d9588083 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -43,7 +43,6 @@ var actions = { unlockInProgress: unlockInProgress, // error handling displayWarning: displayWarning, - showWarning: showWarning, // alias DISPLAY_WARNING: 'DISPLAY_WARNING', HIDE_WARNING: 'HIDE_WARNING', hideWarning: hideWarning, @@ -180,7 +179,7 @@ function createNewVault (password, entropy) { dispatch(actions.createNewVaultInProgress()) _accountManager.createNewVault(password, entropy, (err, result) => { if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } dispatch(actions.showNewVaultSeed(result)) }) @@ -355,7 +354,7 @@ function agreeToDisclaimer () { dispatch(this.showLoadingIndication()) _accountManager.agreeToDisclaimer((err) => { if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } dispatch(this.hideLoadingIndication()) @@ -420,7 +419,7 @@ function lockMetamask () { _accountManager.setLocked((err) => { dispatch(actions.hideLoadingIndication()) if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } dispatch({ @@ -436,7 +435,7 @@ function showAccountDetail (address) { _accountManager.setSelectedAddress(address, (err, address) => { dispatch(actions.hideLoadingIndication()) if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } dispatch({ @@ -466,7 +465,7 @@ function confirmSeedWords () { _accountManager.clearSeedWordCache((err, account) => { dispatch(actions.hideLoadingIndication()) if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } console.log('Seed word cache cleared. ' + account) @@ -571,10 +570,6 @@ function hideSubLoadingIndication () { } } -function showWarning (text) { - return this.displayWarning(text) -} - function displayWarning (text) { return { type: actions.DISPLAY_WARNING, @@ -626,7 +621,7 @@ function saveAccountLabel (account, label) { _accountManager.saveAccountLabel(account, label, (err) => { dispatch(actions.hideLoadingIndication()) if (err) { - return dispatch(actions.showWarning(err.message)) + return dispatch(actions.displayWarning(err.message)) } dispatch({ type: actions.SAVE_ACCOUNT_LABEL, @@ -721,7 +716,7 @@ function shapeShiftSubview (network) { shapeShiftRequest('marketinfo', {pair}, (mktResponse) => { shapeShiftRequest('getcoins', {}, (response) => { dispatch(actions.hideSubLoadingIndication()) - if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error)) + if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error)) dispatch({ type: actions.SHAPESHIFT_SUBVIEW, value: { @@ -738,7 +733,7 @@ function coinShiftRquest (data, marketData) { return (dispatch) => { dispatch(actions.showLoadingIndication()) shapeShiftRequest('shift', { method: 'POST', data}, (response) => { - if (response.error) return dispatch(actions.showWarning(response.error)) + if (response.error) return dispatch(actions.displayWarning(response.error)) var message = ` Deposit your ${response.depositType} to the address bellow:` _accountManager.createShapeShiftTx(response.deposit, response.depositType) @@ -760,7 +755,7 @@ function reshowQrCode (data, coin) { return (dispatch) => { dispatch(actions.showLoadingIndication()) shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => { - if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error)) + if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error)) var message = [ `Deposit your ${coin} to the address bellow:`, diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js index efd05ec96..3c5708bf8 100644 --- a/ui/app/components/coinbase-form.js +++ b/ui/app/components/coinbase-form.js @@ -116,10 +116,10 @@ CoinbaseForm.prototype.toCoinbase = function () { props.dispatch(actions.buyEth(address, props.buyView.amount)) } else if (!isValidAmountforCoinBase(amount).valid) { message = isValidAmountforCoinBase(amount).message - return props.dispatch(actions.showWarning(message)) + return props.dispatch(actions.displayWarning(message)) } else { message = 'Receiving address is invalid.' - return props.dispatch(actions.showWarning(message)) + return props.dispatch(actions.displayWarning(message)) } } diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js index 2bb384b94..1da549288 100644 --- a/ui/app/components/shapeshift-form.js +++ b/ui/app/components/shapeshift-form.js @@ -244,7 +244,7 @@ ShapeshiftForm.prototype.updateCoin = function (event) { if (!coinOptions[coin.toUpperCase()] || coin.toUpperCase() === 'ETH') { var message = 'Not a valid coin' - return props.dispatch(actions.showWarning(message)) + return props.dispatch(actions.displayWarning(message)) } else { return props.dispatch(actions.pairUpdate(coin)) } |