From 00bae744757d0a83c5a7e27adaa70107313bcaac Mon Sep 17 00:00:00 2001 From: Jenny Pollack Date: Tue, 24 Jul 2018 14:16:37 -0700 Subject: tx-gas-utils - catch all errors from gas estimation --- app/scripts/controllers/transactions/tx-gas-utils.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/scripts/controllers') 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 -- cgit v1.2.3