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

DRY up common code in contract classes #3561

Open
fselmo opened this issue Dec 16, 2024 · 0 comments · May be fixed by #3579
Open

DRY up common code in contract classes #3561

fselmo opened this issue Dec 16, 2024 · 0 comments · May be fixed by #3579

Comments

@fselmo
Copy link
Collaborator

fselmo commented Dec 16, 2024

Working on #3540, I noticed a lot of the code that was cleaned up there can ideally be removed from the contract.py and async_contract.py into base_contract.py since the code is nearly identical. The biggest issue I can see to resolve may be the typing, which is why this warrants a separate issue since it's out of the scope of that PR.

Investigate the following, and perhaps other cases:

  • refactor __call__() in ContractFunction (+ respective async code) to BaseContractFunction
  • refactor __getattr__(), __getitem__() and __iter__() in ContractEvents and ContractFunctions (+ respective async code) to BaseContractEvents and BaseContractFunctions, respectively.
@fselmo fselmo changed the title Clean up common code in contract classes DRY up common code in contract classes Dec 16, 2024
@reedsa reedsa linked a pull request Jan 21, 2025 that will close this issue
3 tasks
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