transactions:gas-utils - handle new type of estimateGas error

feature/default_network_editable
frankiebee 7 years ago
parent 115c5e3a43
commit 828734b977
  1. 6
      app/scripts/lib/tx-gas-utils.js

@ -22,7 +22,11 @@ module.exports = class txProvideUtil {
try { try {
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit) estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit)
} catch (err) { } 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 txMeta.simulationFails = true
return txMeta return txMeta
} }

Loading…
Cancel
Save