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 function overloading in pypechain to adhere to function overloading in web3py v7.6.0 #150

Closed
slundqui opened this issue Dec 3, 2024 · 1 comment · Fixed by #151
Closed

Comments

@slundqui
Copy link
Contributor

slundqui commented Dec 3, 2024

Function overloading is broken with update v7.6.0 in web3py, due to abi validation when calling contract function factories without arguments. We likely can fix when the option to turn off abi validation gets implemented.

v7.6.0 does fix #149 in the case where there are no event overloading (which pypechain currently doesn't support).

@slundqui
Copy link
Contributor Author

slundqui commented Dec 3, 2024

We can sidestep once this gets implemented:
ethereum/web3.py#3536

@slundqui slundqui linked a pull request Dec 4, 2024 that will close this issue
slundqui added a commit that referenced this issue Dec 5, 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.
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 a pull request may close this issue.

1 participant