1212
1313from ethereum_test_benchmark .benchmark_code_generator import ExtCallGenerator , JumpLoopGenerator
1414from ethereum_test_forks import Fork
15- from ethereum_test_specs import BlockchainTestFiller
15+ from ethereum_test_specs import BlockchainTestFiller , StateTestFiller
1616from ethereum_test_specs .benchmark import BenchmarkTestFiller
1717from ethereum_test_tools import (
1818 Account ,
@@ -339,6 +339,7 @@ def test_worst_storage_access_cold(
339339
340340 op_tx = Transaction (
341341 to = contract_address ,
342+ gas_limit = gas_benchmark_value ,
342343 sender = pre .fund_eoa (),
343344 )
344345 blocks .append (Block (txs = [op_tx ]))
@@ -365,6 +366,7 @@ def test_worst_storage_access_warm(
365366 benchmark_test : BenchmarkTestFiller ,
366367 pre : Alloc ,
367368 storage_action : StorageAction ,
369+ gas_benchmark_value : int ,
368370 env : Environment ,
369371):
370372 """Test running a block with as many warm storage slot accesses as possible."""
@@ -410,6 +412,7 @@ def test_worst_storage_access_warm(
410412
411413 op_tx = Transaction (
412414 to = contract_address ,
415+ gas_limit = gas_benchmark_value ,
413416 sender = pre .fund_eoa (),
414417 )
415418 blocks .append (Block (txs = [op_tx ]))
@@ -424,6 +427,7 @@ def test_worst_storage_access_warm(
424427def test_worst_blockhash (
425428 blockchain_test : BlockchainTestFiller ,
426429 pre : Alloc ,
430+ gas_benchmark_value : int ,
427431):
428432 """Test running a block with as many blockhash accessing oldest allowed block as possible."""
429433 # Create 256 dummy blocks to fill the blockhash window.
@@ -436,6 +440,7 @@ def test_worst_blockhash(
436440 execution_code_address = pre .deploy_contract (code = execution_code )
437441 op_tx = Transaction (
438442 to = execution_code_address ,
443+ gas_limit = gas_benchmark_value ,
439444 sender = pre .fund_eoa (),
440445 )
441446 blocks .append (Block (txs = [op_tx ]))
@@ -639,7 +644,7 @@ def test_worst_selfdestruct_existing(
639644
640645@pytest .mark .parametrize ("value_bearing" , [True , False ])
641646def test_worst_selfdestruct_created (
642- benchmark_test : BenchmarkTestFiller ,
647+ state_test : StateTestFiller ,
643648 pre : Alloc ,
644649 value_bearing : bool ,
645650 fork : Fork ,
@@ -722,11 +727,12 @@ def test_worst_selfdestruct_created(
722727 )
723728 code_tx = Transaction (
724729 to = code_addr ,
730+ gas_limit = gas_benchmark_value ,
725731 sender = pre .fund_eoa (),
726732 )
727733
728734 post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
729- benchmark_test (
735+ state_test (
730736 pre = pre ,
731737 post = post ,
732738 tx = code_tx ,
@@ -736,7 +742,7 @@ def test_worst_selfdestruct_created(
736742
737743@pytest .mark .parametrize ("value_bearing" , [True , False ])
738744def test_worst_selfdestruct_initcode (
739- benchmark_test : BenchmarkTestFiller ,
745+ state_test : StateTestFiller ,
740746 pre : Alloc ,
741747 value_bearing : bool ,
742748 fork : Fork ,
@@ -807,8 +813,7 @@ def test_worst_selfdestruct_initcode(
807813 )
808814
809815 post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
810- benchmark_test (
811- env = env ,
816+ state_test (
812817 pre = pre ,
813818 post = post ,
814819 tx = code_tx ,
0 commit comments