Skip to content

Commit

Permalink
chore: extract method Contract.__post_init__ (#310)
Browse files Browse the repository at this point in the history
This lets me make the change I need in a downstream lib
  • Loading branch information
BobTheBuidler authored Nov 29, 2024
1 parent 6a52b18 commit 1c9fb4f
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 1c9fb4f

Please sign in to comment.