Added better error detection when pre-EIP-155 transactions are disabled.

This commit is contained in:
Richard Moore 2021-04-17 18:10:27 -04:00
parent eb1ec2f231
commit b8df000c8f
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -65,6 +65,13 @@ function checkError(method: string, error: any, params: any): any {
});
}
// "replacement transaction underpriced"
if (message.match(/only replay-protected/)) {
logger.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
error, method, transaction
});
}
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted/)) {
logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
error, method, transaction