1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

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

This commit is contained in:
frankiebee 2017-12-14 18:15:38 -08:00
parent 115c5e3a43
commit 828734b977

View File

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