Skip to content

Commit

Permalink
refactor(fw): use pydantic PrivateAttr for model class params
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed Jun 12, 2024
1 parent e5794c7 commit a8e504b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ethereum_test_tools/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
BaseModel,
ConfigDict,
Field,
PrivateAttr,
RootModel,
TypeAdapter,
computed_field,
Expand Down Expand Up @@ -575,9 +576,9 @@ class Alloc(RootModel[Dict[Address, Account | None]]):

root: Dict[Address, Account | None] = Field(default_factory=dict, validate_default=True)

_alloc_mode: ClassVar[AllocMode] = AllocMode.PERMISSIVE
_start_contract_address: ClassVar[int] = 0x1000
_contract_address_increments: ClassVar[int] = 0x100
_alloc_mode: AllocMode = PrivateAttr(default=AllocMode.PERMISSIVE)
_start_contract_address: int = PrivateAttr(default=0x1000)
_contract_address_increments: int = PrivateAttr(default=0x100)

@dataclass(kw_only=True)
class UnexpectedAccount(Exception):
Expand Down

0 comments on commit a8e504b

Please sign in to comment.