|
|
@ -30,14 +30,10 @@ class TxGasUtil { |
|
|
|
try { |
|
|
|
try { |
|
|
|
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit) |
|
|
|
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit) |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
const simulationFailed = ( |
|
|
|
txMeta.simulationFails = { |
|
|
|
err.message.includes('Transaction execution error.') || |
|
|
|
reason: err.message, |
|
|
|
err.message.includes('gas required exceeds allowance or always failing transaction') |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
if (simulationFailed) { |
|
|
|
|
|
|
|
txMeta.simulationFails = true |
|
|
|
|
|
|
|
return txMeta |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return txMeta |
|
|
|
} |
|
|
|
} |
|
|
|
this.setTxGas(txMeta, block.gasLimit, estimatedGasHex) |
|
|
|
this.setTxGas(txMeta, block.gasLimit, estimatedGasHex) |
|
|
|
return txMeta |
|
|
|
return txMeta |
|
|
|