aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2017-12-19 02:11:38 +0800
committerGitHub <noreply@github.com>2017-12-19 02:11:38 +0800
commit84dece92a6214b4ee562f69194c964a935e27af8 (patch)
tree6657da020cc15d64490fbd7b602a136ed403988f
parent60081b88d6750ee7ef4b9edbab647b75a7fe6336 (diff)
parent0daeaeb4a84514c9a703f1e38ab02e26b3e5a9a7 (diff)
downloadtangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.gz
tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.zst
tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.zip
Merge pull request #2751 from MetaMask/i#2720
transactions:gas-utils - handle new type of estimateGas error
-rw-r--r--app/scripts/lib/tx-gas-utils.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js
index 7e72ea71d..56bee19f7 100644
--- a/app/scripts/lib/tx-gas-utils.js
+++ b/app/scripts/lib/tx-gas-utils.js
@@ -22,7 +22,11 @@ module.exports = class txProvideUtil {
try {
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit)
} catch (err) {
- if (err.message.includes('Transaction execution error.')) {
+ 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
}