Skip to content

Commit

Permalink
Handle new errors raised by geth v1.9.15
Browse files Browse the repository at this point in the history
This is the minimal change to make the tests pass, again. The code is
cleaned up in the following commits.

See https://github.com/ethereum/go-ethereum/releases/tag/v1.9.15 for
more information about the changes in error handling.
  • Loading branch information
karlb authored and ulope committed Nov 6, 2020
1 parent 9fbfc4a commit c9ca9d4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion raiden/network/rpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,11 @@ def inspect_client_error(
if "insufficient funds" in error["message"]:
return ClientErrorInspectResult.INSUFFICIENT_FUNDS

if "always failing transaction" in error["message"]:
if (
"always failing transaction" in error["message"]
or "execution reverted" in error["message"]
or "invalid opcode: opcode 0xfe not defined" in error["message"]
):
return ClientErrorInspectResult.ALWAYS_FAIL

if "replacement transaction underpriced" in error["message"]:
Expand Down Expand Up @@ -543,6 +547,15 @@ def check_value_error_for_parity(value_error: ValueError, call_type: ParityCallT
code_checks_out = error_data["code"] == -32016
message_checks_out = "The execution failed due to an exception" in error_data["message"]
elif call_type == ParityCallType.CALL:
# TODO: refactor
# TODO: rename
if (
error_data["code"] == -32000
and "invalid opcode: opcode 0xfe not defined" in error_data["message"]
):
return True
if error_data["code"] == -32000 and "execution reverted" in error_data["message"]:
return True
code_checks_out = error_data["code"] == -32015
message_checks_out = "VM execution error" in error_data["message"]
else:
Expand Down

0 comments on commit c9ca9d4

Please sign in to comment.