12
12
13
13
from ethereum_test_benchmark .benchmark_code_generator import ExtCallGenerator , JumpLoopGenerator
14
14
from ethereum_test_forks import Fork
15
- from ethereum_test_specs import BlockchainTestFiller
15
+ from ethereum_test_specs import BlockchainTestFiller , StateTestFiller
16
16
from ethereum_test_specs .benchmark import BenchmarkTestFiller
17
17
from ethereum_test_tools import (
18
18
Account ,
@@ -339,6 +339,7 @@ def test_worst_storage_access_cold(
339
339
340
340
op_tx = Transaction (
341
341
to = contract_address ,
342
+ gas_limit = gas_benchmark_value ,
342
343
sender = pre .fund_eoa (),
343
344
)
344
345
blocks .append (Block (txs = [op_tx ]))
@@ -365,6 +366,7 @@ def test_worst_storage_access_warm(
365
366
benchmark_test : BenchmarkTestFiller ,
366
367
pre : Alloc ,
367
368
storage_action : StorageAction ,
369
+ gas_benchmark_value : int ,
368
370
env : Environment ,
369
371
):
370
372
"""Test running a block with as many warm storage slot accesses as possible."""
@@ -410,6 +412,7 @@ def test_worst_storage_access_warm(
410
412
411
413
op_tx = Transaction (
412
414
to = contract_address ,
415
+ gas_limit = gas_benchmark_value ,
413
416
sender = pre .fund_eoa (),
414
417
)
415
418
blocks .append (Block (txs = [op_tx ]))
@@ -424,6 +427,7 @@ def test_worst_storage_access_warm(
424
427
def test_worst_blockhash (
425
428
blockchain_test : BlockchainTestFiller ,
426
429
pre : Alloc ,
430
+ gas_benchmark_value : int ,
427
431
):
428
432
"""Test running a block with as many blockhash accessing oldest allowed block as possible."""
429
433
# Create 256 dummy blocks to fill the blockhash window.
@@ -436,6 +440,7 @@ def test_worst_blockhash(
436
440
execution_code_address = pre .deploy_contract (code = execution_code )
437
441
op_tx = Transaction (
438
442
to = execution_code_address ,
443
+ gas_limit = gas_benchmark_value ,
439
444
sender = pre .fund_eoa (),
440
445
)
441
446
blocks .append (Block (txs = [op_tx ]))
@@ -639,7 +644,7 @@ def test_worst_selfdestruct_existing(
639
644
640
645
@pytest .mark .parametrize ("value_bearing" , [True , False ])
641
646
def test_worst_selfdestruct_created (
642
- benchmark_test : BenchmarkTestFiller ,
647
+ state_test : StateTestFiller ,
643
648
pre : Alloc ,
644
649
value_bearing : bool ,
645
650
fork : Fork ,
@@ -722,11 +727,12 @@ def test_worst_selfdestruct_created(
722
727
)
723
728
code_tx = Transaction (
724
729
to = code_addr ,
730
+ gas_limit = gas_benchmark_value ,
725
731
sender = pre .fund_eoa (),
726
732
)
727
733
728
734
post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
729
- benchmark_test (
735
+ state_test (
730
736
pre = pre ,
731
737
post = post ,
732
738
tx = code_tx ,
@@ -736,7 +742,7 @@ def test_worst_selfdestruct_created(
736
742
737
743
@pytest .mark .parametrize ("value_bearing" , [True , False ])
738
744
def test_worst_selfdestruct_initcode (
739
- benchmark_test : BenchmarkTestFiller ,
745
+ state_test : StateTestFiller ,
740
746
pre : Alloc ,
741
747
value_bearing : bool ,
742
748
fork : Fork ,
@@ -807,8 +813,7 @@ def test_worst_selfdestruct_initcode(
807
813
)
808
814
809
815
post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
810
- benchmark_test (
811
- env = env ,
816
+ state_test (
812
817
pre = pre ,
813
818
post = post ,
814
819
tx = code_tx ,
0 commit comments