3232from .debugging import print_traces
3333from .helpers import verify_transactions
3434
35- TARGET_BLOB_GAS_PER_BLOCK = 393216
36-
3735
3836class StateTest (BaseTest ):
3937 """
@@ -58,7 +56,7 @@ class StateTest(BaseTest):
5856 TransactionPost ,
5957 ]
6058
61- def _generate_blockchain_genesis_environment (self ) -> Environment :
59+ def _generate_blockchain_genesis_environment (self , * , fork : Fork ) -> Environment :
6260 """
6361 Generate the genesis environment for the BlockchainTest formatted test.
6462 """
@@ -79,8 +77,8 @@ def _generate_blockchain_genesis_environment(self) -> Environment:
7977 # set the excess blob gas by setting the excess blob gas of the genesis block
8078 # to the expected value plus the TARGET_BLOB_GAS_PER_BLOCK, which is the value
8179 # that will be subtracted from the excess blob gas when the first block is mined.
82- updated_values ["excess_blob_gas" ] = (
83- self . env . excess_blob_gas + TARGET_BLOB_GAS_PER_BLOCK
80+ updated_values ["excess_blob_gas" ] = self . env . excess_blob_gas + (
81+ fork . target_blobs_per_block () * fork . blob_gas_per_blob ()
8482 )
8583
8684 return self .env .copy (** updated_values )
@@ -107,12 +105,12 @@ def _generate_blockchain_blocks(self) -> List[Block]:
107105 )
108106 ]
109107
110- def generate_blockchain_test (self ) -> BlockchainTest :
108+ def generate_blockchain_test (self , * , fork : Fork ) -> BlockchainTest :
111109 """
112110 Generate a BlockchainTest fixture from this StateTest fixture.
113111 """
114112 return BlockchainTest (
115- genesis_environment = self ._generate_blockchain_genesis_environment (),
113+ genesis_environment = self ._generate_blockchain_genesis_environment (fork = fork ),
116114 pre = self .pre ,
117115 post = self .post ,
118116 blocks = self ._generate_blockchain_blocks (),
@@ -195,7 +193,7 @@ def generate(
195193 Generate the BlockchainTest fixture.
196194 """
197195 if fixture_format in BlockchainTest .supported_fixture_formats :
198- return self .generate_blockchain_test ().generate (
196+ return self .generate_blockchain_test (fork = fork ).generate (
199197 request = request , t8n = t8n , fork = fork , fixture_format = fixture_format , eips = eips
200198 )
201199 elif fixture_format == StateFixture :
0 commit comments