mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
tx-gas-utils - catch all errors from gas estimation
This commit is contained in:
parent
b208d33b3b
commit
00bae74475
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user