aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-gas-utils.js
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-12-15 10:15:38 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-12-15 17:31:48 +0800
commit828734b977f7c26c249c81af73fc8eef0b66e416 (patch)
treeaa2abd44feed0b45ce75d5d558f98b9ee180e8a4 /app/scripts/lib/tx-gas-utils.js
parent115c5e3a43103476682735bc3c840b9d429165ed (diff)
downloadtangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar.gz
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar.bz2
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar.lz
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar.xz
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.tar.zst
tangerine-wallet-browser-828734b977f7c26c249c81af73fc8eef0b66e416.zip
transactions:gas-utils - handle new type of estimateGas error
Diffstat (limited to 'app/scripts/lib/tx-gas-utils.js')
-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
}