1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Merge pull request #2751 from MetaMask/i#2720

transactions:gas-utils - handle new type of estimateGas error
This commit is contained in:
Thomas Huang 2017-12-18 13:11:38 -05:00 committed by GitHub
commit 84dece92a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}