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

Updates for web3py v7.6. Includes version bump to v0.0.48 #151

Merged
merged 11 commits into from
Dec 5, 2024

Conversation

slundqui
Copy link
Contributor

@slundqui slundqui commented Dec 4, 2024

This PR updates pypechain to work with web3py v7.6. Solves both #149 and #150. Includes version bump to v0.0.48.

Breaking Changes

  • my_contract.events.MyEvent is no longer a type, but instead the instantiated object. This means calls to e.g., events.MyEvent().process_receipt_typed() will now be events.MyEvent.process_receipt_typed().

Major changes

  • Changing handling of my_contract.events. Note overloaded events still are not implemented.
  • Adding new pypechain class PypechainOverloadedFunctions that acts as a wrapper to the underlying overloaded functions.
  • Delay calling the overloaded function factory until the arguments gets bound to the contract function.

Minor changes

  • Pin web3py to v7.6 for futureproofing.
  • Separate makefile builds to test and example.
  • Using solidity compiler 0.8.24 for test gen.

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 63.03318% with 156 lines in your changes missing coverage. Please review.

Project coverage is 74.07%. Comparing base (02d6973) to head (8b491e2).

Files with missing lines Patch % Lines
...in/test/structs/types/StructsA/StructsAContract.py 10.00% 27 Missing ⚠️
...in/test/structs/types/StructsB/StructsBContract.py 10.00% 18 Missing ⚠️
...in/test/structs/types/StructsC/StructsCContract.py 10.00% 18 Missing ⚠️
...urn_types/types/ReturnTypes/ReturnTypesContract.py 86.66% 16 Missing ⚠️
...ithStructArgs/ConstructorWithStructArgsContract.py 50.00% 15 Missing ⚠️
...pechain/test/events/types/Events/EventsContract.py 67.64% 11 Missing ⚠️
pypechain/utilities/format.py 23.07% 10 Missing ⚠️
...pes/ConstructorNoArgs/ConstructorNoArgsContract.py 60.00% 8 Missing ⚠️
...ConstructorWithArgs/ConstructorWithArgsContract.py 60.00% 8 Missing ⚠️
...yment/types/NoConstructor/NoConstructorContract.py 60.00% 8 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
- Coverage   75.50%   74.07%   -1.43%     
==========================================
  Files          80       80              
  Lines        3600     3830     +230     
==========================================
+ Hits         2718     2837     +119     
- Misses        882      993     +111     
Flag Coverage Δ
unittests 74.07% <63.03%> (-1.43%) ⬇️

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 Updates for web3py v7.6 Updates for web3py v7.6. Includes version bump to v0.0.48 Dec 4, 2024
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.

very elegant solution! Great job

@slundqui slundqui merged commit 6346cf4 into main Dec 5, 2024
6 checks passed
@slundqui slundqui deleted the web3py-update branch December 5, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants