File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/ethereum_test_fixtures Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ class SharedPreStateGroup(CamelModel):
30
30
fork : Fork = Field (..., alias = "network" )
31
31
pre : Alloc
32
32
33
- def __model_post_init__ (self ) -> None :
33
+ def model_post_init (self , __context ) :
34
34
"""Post-init hook to ensure pre is not None."""
35
+ super ().model_post_init (__context )
36
+
35
37
self .pre = Alloc .merge (
36
38
Alloc .model_validate (self .fork .pre_allocation_blockchain ()),
37
39
self .pre ,
@@ -56,12 +58,9 @@ def to_file(self, file: Path) -> None:
56
58
f .read ()
57
59
)
58
60
for account in previous_shared_pre_state_group .pre :
59
- if account in self .pre :
60
- raise ValueError (
61
- f"Account { account } already exists in shared pre-allocation"
62
- )
63
- self .pre [account ] = previous_shared_pre_state_group .pre [account ]
64
- self .pre_account_count += 1
61
+ if account not in self .pre :
62
+ self .pre [account ] = previous_shared_pre_state_group .pre [account ]
63
+ self .pre_account_count += previous_shared_pre_state_group .pre_account_count
65
64
self .test_count += previous_shared_pre_state_group .test_count
66
65
self .test_ids .extend (previous_shared_pre_state_group .test_ids )
67
66
You can’t perform that action at this time.
0 commit comments