1010from hive .testing import HiveTestSuite
1111
1212from ethereum_test_base_types import to_json
13+ from ethereum_test_fixtures import BlockchainEngineXFixture
1314from ethereum_test_fixtures .blockchain import FixtureHeader
15+ from ethereum_test_fixtures .pre_alloc_groups import PreAllocGroup
1416from pytest_plugins .consume .consume import FixturesSource
1517from pytest_plugins .consume .simulators .helpers .ruleset import (
1618 ruleset , # TODO: generate dynamically
2426
2527
2628@pytest .fixture (scope = "session" )
27- def shared_pre_state_cache () -> Dict [str , SharedPreStateGroup ]:
29+ def shared_pre_state_cache () -> Dict [str , PreAllocGroup ]:
2830 """Cache for shared pre-state groups to avoid reloading from disk."""
2931 return {}
3032
3133
3234@pytest .fixture (scope = "function" )
3335def shared_pre_state_group (
34- fixture : BlockchainEngineReorgFixture ,
36+ fixture : BlockchainEngineXFixture ,
3537 fixtures_source : FixturesSource ,
36- shared_pre_state_cache : Dict [str , SharedPreStateGroup ],
37- ) -> SharedPreStateGroup :
38+ shared_pre_state_cache : Dict [str , PreAllocGroup ],
39+ ) -> PreAllocGroup :
3840 """Load the shared pre-state group for the current test case."""
3941 pre_hash = fixture .pre_hash
4042
@@ -48,20 +50,20 @@ def shared_pre_state_group(
4850
4951 # Look for shared pre-allocation file using FixtureOutput path structure
5052 fixture_output = FixtureOutput (output_path = fixtures_source .path )
51- shared_alloc_path = fixture_output .shared_pre_alloc_folder_path / f"{ pre_hash } .json"
53+ shared_alloc_path = fixture_output .pre_alloc_groups_folder_path / f"{ pre_hash } .json"
5254 if not shared_alloc_path .exists ():
5355 raise FileNotFoundError (f"Shared pre-allocation file not found: { shared_alloc_path } " )
5456
5557 # Load and cache
5658 with open (shared_alloc_path ) as f :
57- shared_group = SharedPreStateGroup .model_validate_json (f .read ())
59+ shared_group = PreAllocGroup .model_validate_json (f .read ())
5860
5961 shared_pre_state_cache [pre_hash ] = shared_group
6062 return shared_group
6163
6264
63- def create_environment (shared_pre_state_group : SharedPreStateGroup , check_live_port : int ) -> dict :
64- """Define environment using SharedPreStateGroup data."""
65+ def create_environment (shared_pre_state_group : PreAllocGroup , check_live_port : int ) -> dict :
66+ """Define environment using PreAllocGroup data."""
6567 fork = shared_pre_state_group .fork
6668 assert fork in ruleset , f"fork '{ fork } ' missing in hive ruleset"
6769 return {
@@ -73,7 +75,7 @@ def create_environment(shared_pre_state_group: SharedPreStateGroup, check_live_p
7375 }
7476
7577
76- def client_files (shared_pre_state_group : SharedPreStateGroup ) -> Mapping [str , io .BufferedReader ]:
78+ def client_files (shared_pre_state_group : PreAllocGroup ) -> Mapping [str , io .BufferedReader ]:
7779 """Define the files that hive will start the client with."""
7880 genesis = to_json (shared_pre_state_group .genesis ) # type: ignore
7981 alloc = to_json (shared_pre_state_group .pre )
@@ -103,7 +105,7 @@ def reorg_client_manager() -> Generator[ReorgClientManager, None, None]:
103105
104106
105107@pytest .fixture (scope = "function" )
106- def genesis_header (shared_pre_state_group : SharedPreStateGroup ) -> FixtureHeader :
108+ def genesis_header (shared_pre_state_group : PreAllocGroup ) -> FixtureHeader :
107109 """Provide the genesis header from the shared pre-state group."""
108110 return shared_pre_state_group .genesis # type: ignore
109111
@@ -113,8 +115,8 @@ def client(
113115 test_suite : HiveTestSuite ,
114116 client_type : ClientType ,
115117 total_timing_data : TimingData ,
116- fixture : BlockchainEngineReorgFixture ,
117- shared_pre_state_group : SharedPreStateGroup ,
118+ fixture : BlockchainEngineXFixture ,
119+ shared_pre_state_group : PreAllocGroup ,
118120 reorg_client_manager : ReorgClientManager ,
119121 fixtures_source : FixturesSource ,
120122) -> Generator [Client , None , None ]:
@@ -125,7 +127,7 @@ def client(
125127 # Set pre-alloc path in manager if not already set
126128 if reorg_client_manager .pre_alloc_path is None :
127129 fixture_output = FixtureOutput (output_path = fixtures_source .path )
128- reorg_client_manager .set_pre_alloc_path (fixture_output .shared_pre_alloc_folder_path )
130+ reorg_client_manager .set_pre_alloc_path (fixture_output .pre_alloc_groups_folder_path )
129131
130132 # Check for existing client
131133 existing_client = reorg_client_manager .get_client_for_test (pre_hash )
0 commit comments