aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2018-07-26 09:33:17 +0800
committerGitHub <noreply@github.com>2018-07-26 09:33:17 +0800
commitb5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3 (patch)
tree882c119f8e531a43f9748913a6cf386ffac38ae2
parenta5d344a58223e029dc86bf33a8ca9357492765f3 (diff)
parent00bae744757d0a83c5a7e27adaa70107313bcaac (diff)
downloadtangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar.gz
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar.bz2
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar.lz
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar.xz
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.tar.zst
tangerine-wallet-browser-b5e3aafe2ecaf36a6d6d24aa905f8b9cd9e805b3.zip
Merge pull request #4871 from MetaMask/3519-new-contract-gas
tx-gas-utils - catch all errors from gas estimation
-rw-r--r--app/scripts/controllers/transactions/tx-gas-utils.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js
index ab4031faa..5cd0f5407 100644
--- a/app/scripts/controllers/transactions/tx-gas-utils.js
+++ b/app/scripts/controllers/transactions/tx-gas-utils.js
@@ -30,14 +30,10 @@ class TxGasUtil {
try {
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit)
} catch (err) {
- const simulationFailed = (
- err.message.includes('Transaction execution error.') ||
- err.message.includes('gas required exceeds allowance or always failing transaction')
- )
- if (simulationFailed) {
- txMeta.simulationFails = true
- return txMeta
+ txMeta.simulationFails = {
+ reason: err.message,
}
+ return txMeta
}
this.setTxGas(txMeta, block.gasLimit, estimatedGasHex)
return txMeta