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

chore: extract method Contract.__post_init__ #310

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dank_mids/brownie_patch/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ def __init__(self, *args, **kwargs):
This method sets up lazy initialization for contract methods.
"""
super().__init__(*args, **kwargs)
# get rid of the contract call objects, we can materialize them on a jit basis
self.__post_init__()

def __post_init__(self) -> None:
"""
Get rid of the contract call objects so we can materialize them on a JIT basis.

This method sets up lazy initialization for contract methods.
"""
for name in self.__method_names__:
if name in {"_name", "_owner"}:
# this is a property defined on _ContractBase and cannot be written to
Expand Down
Loading