Skip to content

Commit

Permalink
src: Only add fcuVersion based on last valid block.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Sep 18, 2023
1 parent 1050c02 commit b363ee8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/ethereum_test_tools/filling/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ def fill_test(
eips=eips,
)

fcu_version: int | None = None
if not test_spec.base_test_config.disable_hive:
last_valid_block = next(
(block.block_header for block in reversed(blocks) if block.expected_exception is None),
None,
)
fcu_version = (
fork.engine_forkchoice_updated_version(
last_valid_block.number, last_valid_block.timestamp
)
if last_valid_block
else None
)

fork_name = fork.name()
fixture = Fixture(
blocks=blocks,
Expand All @@ -44,12 +58,8 @@ def fill_test(
pre_state=pre,
post_state=alloc_to_accounts(alloc),
seal_engine=engine,
fcu_version=fork.engine_forkchoice_updated_version(
blocks[-1].block_header.number, blocks[-1].block_header.timestamp
)
if not test_spec.base_test_config.disable_hive and blocks[-1].block_header
else None,
name=test_spec.tag,
fcu_version=fcu_version,
)
fixture.fill_info(t8n, spec)

Expand Down

0 comments on commit b363ee8

Please sign in to comment.