Skip to content

Commit

Permalink
Added better error detection when pre-EIP-155 transactions are disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 17, 2021
1 parent eb1ec2f commit b8df000
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/providers/src.ts/json-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8df000

Please sign in to comment.