diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2017-12-19 02:11:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 02:11:38 +0800 |
commit | 84dece92a6214b4ee562f69194c964a935e27af8 (patch) | |
tree | 6657da020cc15d64490fbd7b602a136ed403988f | |
parent | 60081b88d6750ee7ef4b9edbab647b75a7fe6336 (diff) | |
parent | 0daeaeb4a84514c9a703f1e38ab02e26b3e5a9a7 (diff) | |
download | tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.gz tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.bz2 tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.lz tangerine-wallet-browser-84dece92a6214b4ee562f69194c964a935e27af8.tar.xz 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.js | 6 |
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 } |