Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved handling of trace queries / exceptions #853

Merged
merged 4 commits into from
Nov 21, 2020

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

Do not attempt to query a trace when the node client does not support it.

How I did it

  1. Added the web3.supports_traces property method. This method calls debug_traceTransaction without any arguments and checks the returned error code. If the return code is -32601, the endpoint does not exist. Any other error means the endpoint does exist.
  2. Within various TransactionReceipt methods, check for web3.supports_traces prior to attempting to query a trace. If False, give a more meaningful error than the standard "RPC endpoint does not exist / is not available".
  3. Fix an issue where reverting transactions would raise if a trace is not available, because of an attempt to access the revert reason.

How to verify it

Run the tests. I've added some new cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant