Closes #3095 by more tightly validating the JSON-RPC responses coming from providers (not just the id as the issue states) while providing good messaging on errors.
This PR also includes the following changes:
Use Web3RPCError instead of a generic Web3ValueError for JSON-RPC errors returned by the provider.
Error log the user_message, debug log the response for RPC errors for better clarity / debugging.
In the spirit of wrapping up breaking changes for v7 and snake-casing some final remnants of camelCase args, capitalize "Of": BlockNumberOutofRange -> BlockNumberOutOfRange
Distinguish between MethodUnavailable (a JSON-RPC error from the node) and MethodNotSupported (web3.py does not support the method, internally, under some conditions).
Re-organize the formatted_response tests to be more readable. Separate test cases into tests where they make sense together: test valid responses, test invalid fields, test valid error responses, test invalid error object, test error formatters and null formatters together.
How was it fixed?
Todo:
[x] Clean up commit history
[x] Add or update documentation related to these changes (including the v7 migration guide)
What was wrong?
Closes #3095 by more tightly validating the JSON-RPC responses coming from providers (not just the
id
as the issue states) while providing good messaging on errors.This PR also includes the following changes:
Web3RPCError
instead of a genericWeb3ValueError
for JSON-RPC errors returned by the provider.user_message
, debug log theresponse
for RPC errors for better clarity / debugging.v7
and snake-casing some final remnants of camelCase args, capitalize "Of":BlockNumberOutofRange
->BlockNumberOutOfRange
MethodUnavailable
(a JSON-RPC error from the node) andMethodNotSupported
(web3.py does not support the method, internally, under some conditions).How was it fixed?
Todo:
v7
migration guide)Cute Animal Picture