aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorJenny Pollack <jennypollack3@gmail.com>2018-07-25 05:16:37 +0800
committerJenny Pollack <jennypollack3@gmail.com>2018-07-25 05:16:37 +0800
commit00bae744757d0a83c5a7e27adaa70107313bcaac (patch)
treee037790c828a3bbaa11ffd99e14de24d01eb791d /app/scripts/controllers
parentb208d33b3b27a7f9c7ca2880e8b292d692651343 (diff)
downloadtangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar.gz
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar.bz2
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar.lz
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar.xz
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.tar.zst
tangerine-wallet-browser-00bae744757d0a83c5a7e27adaa70107313bcaac.zip
tx-gas-utils - catch all errors from gas estimation
Diffstat (limited to 'app/scripts/controllers')
-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