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

fix: issue where parity style traces did not work in ape-geth provider #907

Merged
merged 5 commits into from Jul 25, 2022

Conversation

banteg
Copy link
Contributor

@banteg banteg commented Jul 23, 2022

What I did

  • fixed a regression when no parity traces were returned
  • added error handling instead of falling back to an empty result

How I did it

How to verify it

chain.provider.get_call_tree should work again

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

Copy link
Contributor

@antazoey antazoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

antazoey
antazoey previously approved these changes Jul 23, 2022
Copy link
Contributor

@antazoey antazoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion about error class used but LGTM

traces = ParityTraceList.parse_obj(raw_trace_list)
response = self._make_request("trace_transaction", [txn_hash])
if "error" in response:
raise ValueError(response["error"]["message"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of ValueError, you could raise ProviderError

fubuloubu
fubuloubu previously approved these changes Jul 23, 2022
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unparalleled-js's fix and can merge

@antazoey antazoey dismissed stale reviews from fubuloubu and themself via 1a7d6c2 July 25, 2022 14:18
@antazoey antazoey changed the title fix: typo for traces and error handling fix: issue where parity style traces did not work in ape-geth provider Jul 25, 2022

raw_trace_list = response.get("result", [])

if not raw_trace_list:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have to do this because I see weird things where some transactions have 0 trace and get_calltree_from_parity_trace expects at least one item in the result.

@antazoey antazoey requested a review from fubuloubu July 25, 2022 14:48
@antazoey antazoey merged commit 087fcdd into ApeWorX:main Jul 25, 2022
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.

None yet

3 participants