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

Event handling in get_logs return type. Includes version bump to v0.0.39 #130

Merged
merged 33 commits into from
Oct 4, 2024

Conversation

slundqui
Copy link
Contributor

@slundqui slundqui commented Oct 3, 2024

Solves #48

This PR adds typed dataclasses as the output of get_logs, with well defined types on the output.

Important changes:

  • This PR introduces pypechain itself as a dependency on any generated classes in an effort to reducing the amount of code generated.
  • We introduce a new function get_typed_logs that returns a dataclass. Web3's get_logs remains unchanged.

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 85.22727% with 13 lines in your changes missing coverage. Please review.

Project coverage is 70.16%. Comparing base (e2db500) to head (7f21d5b).

Files with missing lines Patch % Lines
pypechain/test/events/types/EventsContract.py 73.33% 4 Missing ⚠️
pypechain/main.py 33.33% 2 Missing ⚠️
pypechain/render/contract.py 50.00% 2 Missing ⚠️
pypechain/render/types.py 33.33% 2 Missing ⚠️
pypechain/core/utilities.py 75.00% 1 Missing ⚠️
pypechain/render/init.py 50.00% 1 Missing ⚠️
pypechain/utilities/abi.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
+ Coverage   64.17%   70.16%   +5.98%     
==========================================
  Files          53       49       -4     
  Lines        2730     2316     -414     
==========================================
- Hits         1752     1625     -127     
+ Misses        978      691     -287     
Flag Coverage Δ
unittests 70.16% <85.22%> (+5.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slundqui slundqui changed the title Event handling in get_logs return type Event handling in get_logs return type. Includes version bump to v0.0.39 Oct 3, 2024
@slundqui slundqui linked an issue Oct 3, 2024 that may be closed by this pull request
Copy link
Contributor

@dpaiton dpaiton left a comment

Choose a reason for hiding this comment

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

I think the gains are worth adding an additional opinionated flow. Great work!

@slundqui slundqui merged commit ee2569b into main Oct 4, 2024
6 checks passed
@slundqui slundqui deleted the slundquist/event-handling branch October 4, 2024 18:25
@slundqui slundqui mentioned this pull request Oct 11, 2024
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.

make events available as dataclasses
3 participants