File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 41
41
"available" ,
42
42
},
43
43
}
44
+ ETH_TESTER_METHOD_NOT_FOUND_RESP_FORMAT = {
45
+ "error" : "the method eth_getTransactionByHash does not exist/is not available" ,
46
+ }
44
47
45
48
46
49
def raise_contract_logic_error (response ):
@@ -121,6 +124,13 @@ def raise_contract_logic_error(response):
121
124
identity ,
122
125
MethodUnavailable ,
123
126
),
127
+ (
128
+ ETH_TESTER_METHOD_NOT_FOUND_RESP_FORMAT ,
129
+ (),
130
+ identity ,
131
+ identity ,
132
+ ValueError ,
133
+ ),
124
134
],
125
135
)
126
136
def test_formatted_response_raises_errors (
Original file line number Diff line number Diff line change @@ -189,8 +189,14 @@ def formatted_response(
189
189
) -> Any :
190
190
if "error" in response :
191
191
apply_error_formatters (error_formatters , response )
192
- if response ["error" ].get ("code" ) == - 32601 :
193
- raise MethodUnavailable (response ["error" ])
192
+
193
+ try :
194
+ resp_code = response ["error" ].get ("code" )
195
+ if resp_code == - 32601 :
196
+ raise MethodUnavailable (response ["error" ])
197
+ # eth-tester returns the error response as a string
198
+ except AttributeError :
199
+ pass
194
200
raise ValueError (response ["error" ])
195
201
# NULL_RESPONSES includes None, so return False here as the default
196
202
# so we don't apply the null_result_formatters if there is no 'result' key
You can’t perform that action at this time.
0 commit comments