mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #801 from MetaMask/deadly
Properly implement 20% gas bump
This commit is contained in:
commit
3775a4bf79
@ -1,6 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## Current Master
|
## Current Master
|
||||||
|
- Fix bug where 20% of gas estimate was not being added properly.
|
||||||
|
|
||||||
## 2.13.7 2016-11-8
|
## 2.13.7 2016-11-8
|
||||||
|
|
||||||
|
@ -262,6 +262,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone
|
|||||||
query.estimateGas(txParams, function(err, result){
|
query.estimateGas(txParams, function(err, result){
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
txData.estimatedGas = self.addGasBuffer(result)
|
txData.estimatedGas = self.addGasBuffer(result)
|
||||||
|
txData.txParams.gasLimit = txData.estimatedGas
|
||||||
cb()
|
cb()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,6 @@ module.exports = class MetamaskController {
|
|||||||
|
|
||||||
let err = this.enforceTxValidations(txParams)
|
let err = this.enforceTxValidations(txParams)
|
||||||
if (err) return onTxDoneCb(err)
|
if (err) return onTxDoneCb(err)
|
||||||
|
|
||||||
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
|
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
|
||||||
if (err) return onTxDoneCb(err)
|
if (err) return onTxDoneCb(err)
|
||||||
this.sendUpdate()
|
this.sendUpdate()
|
||||||
|
@ -43,7 +43,6 @@ var actions = {
|
|||||||
unlockInProgress: unlockInProgress,
|
unlockInProgress: unlockInProgress,
|
||||||
// error handling
|
// error handling
|
||||||
displayWarning: displayWarning,
|
displayWarning: displayWarning,
|
||||||
showWarning: showWarning, // alias
|
|
||||||
DISPLAY_WARNING: 'DISPLAY_WARNING',
|
DISPLAY_WARNING: 'DISPLAY_WARNING',
|
||||||
HIDE_WARNING: 'HIDE_WARNING',
|
HIDE_WARNING: 'HIDE_WARNING',
|
||||||
hideWarning: hideWarning,
|
hideWarning: hideWarning,
|
||||||
@ -180,7 +179,7 @@ function createNewVault (password, entropy) {
|
|||||||
dispatch(actions.createNewVaultInProgress())
|
dispatch(actions.createNewVaultInProgress())
|
||||||
_accountManager.createNewVault(password, entropy, (err, result) => {
|
_accountManager.createNewVault(password, entropy, (err, result) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
dispatch(actions.showNewVaultSeed(result))
|
dispatch(actions.showNewVaultSeed(result))
|
||||||
})
|
})
|
||||||
@ -355,7 +354,7 @@ function agreeToDisclaimer () {
|
|||||||
dispatch(this.showLoadingIndication())
|
dispatch(this.showLoadingIndication())
|
||||||
_accountManager.agreeToDisclaimer((err) => {
|
_accountManager.agreeToDisclaimer((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(this.hideLoadingIndication())
|
dispatch(this.hideLoadingIndication())
|
||||||
@ -420,7 +419,7 @@ function lockMetamask () {
|
|||||||
_accountManager.setLocked((err) => {
|
_accountManager.setLocked((err) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
@ -436,7 +435,7 @@ function showAccountDetail (address) {
|
|||||||
_accountManager.setSelectedAddress(address, (err, address) => {
|
_accountManager.setSelectedAddress(address, (err, address) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
@ -466,7 +465,7 @@ function confirmSeedWords () {
|
|||||||
_accountManager.clearSeedWordCache((err, account) => {
|
_accountManager.clearSeedWordCache((err, account) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Seed word cache cleared. ' + account)
|
console.log('Seed word cache cleared. ' + account)
|
||||||
@ -571,10 +570,6 @@ function hideSubLoadingIndication () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showWarning (text) {
|
|
||||||
return this.displayWarning(text)
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayWarning (text) {
|
function displayWarning (text) {
|
||||||
return {
|
return {
|
||||||
type: actions.DISPLAY_WARNING,
|
type: actions.DISPLAY_WARNING,
|
||||||
@ -626,7 +621,7 @@ function saveAccountLabel (account, label) {
|
|||||||
_accountManager.saveAccountLabel(account, label, (err) => {
|
_accountManager.saveAccountLabel(account, label, (err) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.showWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
}
|
}
|
||||||
dispatch({
|
dispatch({
|
||||||
type: actions.SAVE_ACCOUNT_LABEL,
|
type: actions.SAVE_ACCOUNT_LABEL,
|
||||||
@ -721,7 +716,7 @@ function shapeShiftSubview (network) {
|
|||||||
shapeShiftRequest('marketinfo', {pair}, (mktResponse) => {
|
shapeShiftRequest('marketinfo', {pair}, (mktResponse) => {
|
||||||
shapeShiftRequest('getcoins', {}, (response) => {
|
shapeShiftRequest('getcoins', {}, (response) => {
|
||||||
dispatch(actions.hideSubLoadingIndication())
|
dispatch(actions.hideSubLoadingIndication())
|
||||||
if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error))
|
if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
|
||||||
dispatch({
|
dispatch({
|
||||||
type: actions.SHAPESHIFT_SUBVIEW,
|
type: actions.SHAPESHIFT_SUBVIEW,
|
||||||
value: {
|
value: {
|
||||||
@ -738,7 +733,7 @@ function coinShiftRquest (data, marketData) {
|
|||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(actions.showLoadingIndication())
|
dispatch(actions.showLoadingIndication())
|
||||||
shapeShiftRequest('shift', { method: 'POST', data}, (response) => {
|
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 = `
|
var message = `
|
||||||
Deposit your ${response.depositType} to the address bellow:`
|
Deposit your ${response.depositType} to the address bellow:`
|
||||||
_accountManager.createShapeShiftTx(response.deposit, response.depositType)
|
_accountManager.createShapeShiftTx(response.deposit, response.depositType)
|
||||||
@ -760,7 +755,7 @@ function reshowQrCode (data, coin) {
|
|||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(actions.showLoadingIndication())
|
dispatch(actions.showLoadingIndication())
|
||||||
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
|
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 = [
|
var message = [
|
||||||
`Deposit your ${coin} to the address bellow:`,
|
`Deposit your ${coin} to the address bellow:`,
|
||||||
|
@ -116,10 +116,10 @@ CoinbaseForm.prototype.toCoinbase = function () {
|
|||||||
props.dispatch(actions.buyEth(address, props.buyView.amount))
|
props.dispatch(actions.buyEth(address, props.buyView.amount))
|
||||||
} else if (!isValidAmountforCoinBase(amount).valid) {
|
} else if (!isValidAmountforCoinBase(amount).valid) {
|
||||||
message = isValidAmountforCoinBase(amount).message
|
message = isValidAmountforCoinBase(amount).message
|
||||||
return props.dispatch(actions.showWarning(message))
|
return props.dispatch(actions.displayWarning(message))
|
||||||
} else {
|
} else {
|
||||||
message = 'Receiving address is invalid.'
|
message = 'Receiving address is invalid.'
|
||||||
return props.dispatch(actions.showWarning(message))
|
return props.dispatch(actions.displayWarning(message))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ ShapeshiftForm.prototype.updateCoin = function (event) {
|
|||||||
|
|
||||||
if (!coinOptions[coin.toUpperCase()] || coin.toUpperCase() === 'ETH') {
|
if (!coinOptions[coin.toUpperCase()] || coin.toUpperCase() === 'ETH') {
|
||||||
var message = 'Not a valid coin'
|
var message = 'Not a valid coin'
|
||||||
return props.dispatch(actions.showWarning(message))
|
return props.dispatch(actions.displayWarning(message))
|
||||||
} else {
|
} else {
|
||||||
return props.dispatch(actions.pairUpdate(coin))
|
return props.dispatch(actions.pairUpdate(coin))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user