Skip to content

Commit 8f8ac0c

Browse files
authored
fix(tests): fix shanghai to cancun transition test genesis file (#2161)
1 parent 894b566 commit 8f8ac0c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/cancun/eip4844_blobs/test_excess_blob_gas_fork_transition.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ def block_gas_limit(fork: Fork) -> int: # noqa: D103
4747

4848

4949
@pytest.fixture
50-
def genesis_environment(block_gas_limit: int, block_base_fee_per_gas: int) -> Environment: # noqa: D103
50+
def genesis_environment(block_gas_limit: int, block_base_fee_per_gas: int) -> Environment:
51+
"""
52+
Genesis environment that enables existing transition tests to be used of BPO forks.
53+
Compatible with all fork transitions.
54+
"""
5155
return Environment(
5256
base_fee_per_gas=(block_base_fee_per_gas * BASE_FEE_MAX_CHANGE_DENOMINATOR) // 7,
5357
gas_limit=block_gas_limit,
@@ -320,7 +324,7 @@ def post( # noqa: D103
320324
@pytest.mark.exception_test
321325
def test_invalid_pre_fork_block_with_blob_fields(
322326
blockchain_test: BlockchainTestFiller,
323-
env: Environment,
327+
genesis_environment: Environment,
324328
pre: Alloc,
325329
pre_fork_blocks: List[Block],
326330
excess_blob_gas_present: bool,
@@ -349,7 +353,7 @@ def test_invalid_pre_fork_block_with_blob_fields(
349353
engine_api_error_code=EngineAPIError.InvalidParams,
350354
)
351355
],
352-
genesis_environment=env,
356+
genesis_environment=genesis_environment,
353357
)
354358

355359

@@ -365,7 +369,7 @@ def test_invalid_pre_fork_block_with_blob_fields(
365369
@pytest.mark.exception_test
366370
def test_invalid_post_fork_block_without_blob_fields(
367371
blockchain_test: BlockchainTestFiller,
368-
env: Environment,
372+
genesis_environment: Environment,
369373
pre: Alloc,
370374
pre_fork_blocks: List[Block],
371375
excess_blob_gas_missing: bool,
@@ -395,7 +399,7 @@ def test_invalid_post_fork_block_without_blob_fields(
395399
engine_api_error_code=EngineAPIError.InvalidParams,
396400
)
397401
],
398-
genesis_environment=env,
402+
genesis_environment=genesis_environment,
399403
)
400404

401405

@@ -419,7 +423,7 @@ def test_invalid_post_fork_block_without_blob_fields(
419423
)
420424
def test_fork_transition_excess_blob_gas_at_blob_genesis(
421425
blockchain_test: BlockchainTestFiller,
422-
env: Environment,
426+
genesis_environment: Environment,
423427
pre: Alloc,
424428
pre_fork_blocks: List[Block],
425429
post_fork_blocks: List[Block],
@@ -435,7 +439,7 @@ def test_fork_transition_excess_blob_gas_at_blob_genesis(
435439
pre=pre,
436440
post=post,
437441
blocks=pre_fork_blocks + post_fork_blocks,
438-
genesis_environment=env,
442+
genesis_environment=genesis_environment,
439443
)
440444

441445

0 commit comments

Comments
 (0)