Better errors on gas estimation failure.

This commit is contained in:
Richard Moore 2019-08-04 19:20:03 -04:00
parent e6bab2e94f
commit 0e6b810def
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -169,7 +169,13 @@ export abstract class Signer {
});
}
if (tx.gasLimit == null) { tx.gasLimit = this.estimateGas(tx); }
if (tx.gasLimit == null) {
tx.gasLimit = this.estimateGas(tx).catch((error) => {
logger.throwError("unable to estimate gas; specify manually", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
tx: tx
});
});
}
if (tx.chainId == null) { tx.chainId = this.getChainId(); }
return resolveProperties(tx);