@@ -264,7 +264,7 @@ def make_blocks(
264264 fork : Fork ,
265265 chain_id = 1 ,
266266 eips : Optional [List [int ]] = None ,
267- ) -> Tuple [List [FixtureBlock ], Hash , Dict [str , Any ]]:
267+ ) -> Tuple [List [FixtureBlock ], Hash , Dict [str , Any ], Optional [ int ] ]:
268268 """
269269 Create a block list from the blockchain test definition.
270270 Performs checks against the expected behavior of the test.
@@ -273,6 +273,9 @@ def make_blocks(
273273 alloc = to_json (pre )
274274 env = Environment .from_parent_header (genesis )
275275 blocks : List [FixtureBlock ] = []
276+ fcu_version : Optional [int ] = None
277+ last_valid : Optional [FixtureHeader ] = None
278+
276279 head = genesis .hash if genesis .hash is not None else Hash (0 )
277280 for block in self .blocks :
278281 fixture_block , env , alloc , head = self .make_block (
@@ -286,14 +289,22 @@ def make_blocks(
286289 eips = eips ,
287290 )
288291 blocks .append (fixture_block )
292+ if block .exception is None :
293+ last_valid = fixture_block .block_header
294+
295+ if not self .base_test_config .disable_hive and last_valid is not None :
296+ fcu_version = fork .engine_forkchoice_updated_version (
297+ block_number = last_valid .number ,
298+ timestamp = last_valid .timestamp ,
299+ )
289300
290301 try :
291302 verify_post_alloc (self .post , alloc )
292303 except Exception as e :
293304 print_traces (t8n .get_traces ())
294305 raise e
295306
296- return (blocks , head , alloc )
307+ return (blocks , head , alloc , fcu_version )
297308
298309
299310BlockchainTestSpec = Callable [[str ], Generator [BlockchainTest , None , None ]]
0 commit comments