Skip to content

Commit c918454

Browse files
committed
fix(consume): update according to renaming in #1760
1 parent edf2e33 commit c918454

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/pytest_plugins/consume/simulators/engine_reorg/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
22
Pytest fixtures for the `consume engine-reorg` simulator.
33
4-
Configures the hive back-end & EL clients for test execution with BlockchainEngineReorgFixtures.
4+
Configures the hive back-end & EL clients for test execution with BlockchainEngineXFixtures.
55
"""
66

77
import pytest
88
from hive.client import Client
99

1010
from ethereum_test_exceptions import ExceptionMapper
11-
from ethereum_test_fixtures import BlockchainEngineReorgFixture
11+
from ethereum_test_fixtures import BlockchainEngineXFixture
1212
from ethereum_test_rpc import EngineRPC
1313

1414
pytest_plugins = (
@@ -22,7 +22,7 @@
2222

2323
def pytest_configure(config):
2424
"""Set the supported fixture formats for the engine simulator."""
25-
config._supported_fixture_formats = [BlockchainEngineReorgFixture.format_name]
25+
config._supported_fixture_formats = [BlockchainEngineXFixture.format_name]
2626

2727

2828
@pytest.fixture(scope="module")

src/pytest_plugins/consume/simulators/helpers/client_wrapper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from ethereum_test_base_types import Number, to_json
1313
from ethereum_test_fixtures import BlockchainFixtureCommon
14-
from ethereum_test_fixtures.shared_alloc import SharedPreStateGroup
14+
from ethereum_test_fixtures.pre_alloc_groups import PreAllocGroup
1515
from ethereum_test_forks import Fork
1616
from pytest_plugins.consume.simulators.helpers.ruleset import ruleset
1717

@@ -203,7 +203,7 @@ def __init__(
203203
self,
204204
pre_hash: str,
205205
client_type: ClientType,
206-
shared_pre_state: SharedPreStateGroup,
206+
shared_pre_state: PreAllocGroup,
207207
):
208208
"""
209209
Initialize a reorg client wrapper.
@@ -296,15 +296,15 @@ def set_pre_alloc_path(self, path: Path) -> None:
296296
self.pre_alloc_path = path
297297
logger.debug(f"Pre-alloc path set to: {path}")
298298

299-
def load_shared_pre_state(self, pre_hash: str) -> SharedPreStateGroup:
299+
def load_shared_pre_state(self, pre_hash: str) -> PreAllocGroup:
300300
"""
301301
Load the shared pre-state for a given preHash.
302302
303303
Args:
304304
pre_hash: The hash identifying the pre-allocation group
305305
306306
Returns:
307-
The loaded SharedPreStateGroup
307+
The loaded PreAllocGroup
308308
309309
Raises:
310310
RuntimeError: If pre-alloc path is not set
@@ -318,7 +318,7 @@ def load_shared_pre_state(self, pre_hash: str) -> SharedPreStateGroup:
318318
if not pre_alloc_file.exists():
319319
raise FileNotFoundError(f"Pre-allocation file not found: {pre_alloc_file}")
320320

321-
return SharedPreStateGroup.model_validate_json(pre_alloc_file.read_text())
321+
return PreAllocGroup.model_validate_json(pre_alloc_file.read_text())
322322

323323
def get_or_create_reorg_client(
324324
self,

src/pytest_plugins/consume/simulators/hive_tests/test_via_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import time
99

1010
from ethereum_test_exceptions import UndefinedException
11-
from ethereum_test_fixtures import BlockchainEngineFixture, BlockchainEngineReorgFixture
11+
from ethereum_test_fixtures import BlockchainEngineFixture, BlockchainEngineXFixture
1212
from ethereum_test_fixtures.blockchain import FixtureHeader
1313
from ethereum_test_rpc import EngineRPC, EthRPC
1414
from ethereum_test_rpc.types import ForkchoiceState, JSONRPCError, PayloadStatusEnum
@@ -33,7 +33,7 @@ def test_blockchain_via_engine(
3333
timing_data: TimingData,
3434
eth_rpc: EthRPC,
3535
engine_rpc: EngineRPC,
36-
fixture: BlockchainEngineFixture | BlockchainEngineReorgFixture,
36+
fixture: BlockchainEngineFixture | BlockchainEngineXFixture,
3737
genesis_header: FixtureHeader,
3838
strict_exception_matching: bool,
3939
):

src/pytest_plugins/consume/simulators/multi_test_client.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from hive.testing import HiveTestSuite
1111

1212
from ethereum_test_base_types import to_json
13-
from ethereum_test_fixtures import BlockchainEngineReorgFixture
13+
from ethereum_test_fixtures import BlockchainEngineXFixture
1414
from ethereum_test_fixtures.blockchain import FixtureHeader
15-
from ethereum_test_fixtures.shared_alloc import SharedPreStateGroup
15+
from ethereum_test_fixtures.pre_alloc_groups import PreAllocGroup
1616
from pytest_plugins.consume.consume import FixturesSource
1717
from pytest_plugins.consume.simulators.helpers.ruleset import (
1818
ruleset, # TODO: generate dynamically
@@ -26,17 +26,17 @@
2626

2727

2828
@pytest.fixture(scope="session")
29-
def shared_pre_state_cache() -> Dict[str, SharedPreStateGroup]:
29+
def shared_pre_state_cache() -> Dict[str, PreAllocGroup]:
3030
"""Cache for shared pre-state groups to avoid reloading from disk."""
3131
return {}
3232

3333

3434
@pytest.fixture(scope="function")
3535
def shared_pre_state_group(
36-
fixture: BlockchainEngineReorgFixture,
36+
fixture: BlockchainEngineXFixture,
3737
fixtures_source: FixturesSource,
38-
shared_pre_state_cache: Dict[str, SharedPreStateGroup],
39-
) -> SharedPreStateGroup:
38+
shared_pre_state_cache: Dict[str, PreAllocGroup],
39+
) -> PreAllocGroup:
4040
"""Load the shared pre-state group for the current test case."""
4141
pre_hash = fixture.pre_hash
4242

@@ -50,20 +50,20 @@ def shared_pre_state_group(
5050

5151
# Look for shared pre-allocation file using FixtureOutput path structure
5252
fixture_output = FixtureOutput(output_path=fixtures_source.path)
53-
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"
5454
if not shared_alloc_path.exists():
5555
raise FileNotFoundError(f"Shared pre-allocation file not found: {shared_alloc_path}")
5656

5757
# Load and cache
5858
with open(shared_alloc_path) as f:
59-
shared_group = SharedPreStateGroup.model_validate_json(f.read())
59+
shared_group = PreAllocGroup.model_validate_json(f.read())
6060

6161
shared_pre_state_cache[pre_hash] = shared_group
6262
return shared_group
6363

6464

65-
def create_environment(shared_pre_state_group: SharedPreStateGroup, check_live_port: int) -> dict:
66-
"""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."""
6767
fork = shared_pre_state_group.fork
6868
assert fork in ruleset, f"fork '{fork}' missing in hive ruleset"
6969
return {
@@ -75,7 +75,7 @@ def create_environment(shared_pre_state_group: SharedPreStateGroup, check_live_p
7575
}
7676

7777

78-
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]:
7979
"""Define the files that hive will start the client with."""
8080
genesis = to_json(shared_pre_state_group.genesis) # type: ignore
8181
alloc = to_json(shared_pre_state_group.pre)
@@ -105,7 +105,7 @@ def reorg_client_manager() -> Generator[ReorgClientManager, None, None]:
105105

106106

107107
@pytest.fixture(scope="function")
108-
def genesis_header(shared_pre_state_group: SharedPreStateGroup) -> FixtureHeader:
108+
def genesis_header(shared_pre_state_group: PreAllocGroup) -> FixtureHeader:
109109
"""Provide the genesis header from the shared pre-state group."""
110110
return shared_pre_state_group.genesis # type: ignore
111111

@@ -115,8 +115,8 @@ def client(
115115
test_suite: HiveTestSuite,
116116
client_type: ClientType,
117117
total_timing_data: TimingData,
118-
fixture: BlockchainEngineReorgFixture,
119-
shared_pre_state_group: SharedPreStateGroup,
118+
fixture: BlockchainEngineXFixture,
119+
shared_pre_state_group: PreAllocGroup,
120120
reorg_client_manager: ReorgClientManager,
121121
fixtures_source: FixturesSource,
122122
) -> Generator[Client, None, None]:
@@ -127,7 +127,7 @@ def client(
127127
# Set pre-alloc path in manager if not already set
128128
if reorg_client_manager.pre_alloc_path is None:
129129
fixture_output = FixtureOutput(output_path=fixtures_source.path)
130-
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)
131131

132132
# Check for existing client
133133
existing_client = reorg_client_manager.get_client_for_test(pre_hash)

0 commit comments

Comments
 (0)