From a8e504b494341045a3c1f395fcf445f1d30b6390 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Wed, 12 Jun 2024 15:00:51 +0200 Subject: [PATCH] refactor(fw): use pydantic PrivateAttr for model class params --- src/ethereum_test_tools/common/types.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ethereum_test_tools/common/types.py b/src/ethereum_test_tools/common/types.py index 8087cb58de..90274ef640 100644 --- a/src/ethereum_test_tools/common/types.py +++ b/src/ethereum_test_tools/common/types.py @@ -32,6 +32,7 @@ BaseModel, ConfigDict, Field, + PrivateAttr, RootModel, TypeAdapter, computed_field, @@ -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):