@@ -251,8 +251,8 @@ def generate_blocks_from_code_generator(self, fork: Fork) -> List[Block]:
251251
252252 return [execution_block ]
253253
254- def generate_blockchain_test (self , fork : Fork ) -> BlockchainTest :
255- """Create a BlockchainTest from this BenchmarkTest ."""
254+ def generate_blocks (self , fork : Fork ) -> List [ Block ] :
255+ """Generate blocks for the benchmark test ."""
256256 set_props = [
257257 name
258258 for name , val in [
@@ -268,7 +268,7 @@ def generate_blockchain_test(self, fork: Fork) -> BlockchainTest:
268268 f"Exactly one must be set, but got { len (set_props )} : { ', ' .join (set_props )} "
269269 )
270270
271- blocks : List [Block ] = self . setup_blocks
271+ blocks : List [Block ] = []
272272
273273 if self .code_generator is not None :
274274 generated_blocks = self .generate_blocks_from_code_generator (fork )
@@ -291,6 +291,12 @@ def generate_blockchain_test(self, fork: Fork) -> BlockchainTest:
291291 "Cannot create BlockchainTest without a code generator, transactions, or blocks"
292292 )
293293
294+ return blocks
295+
296+ def generate_blockchain_test (self , fork : Fork ) -> BlockchainTest :
297+ """Create a BlockchainTest from this BenchmarkTest."""
298+ blocks : List [Block ] = self .setup_blocks + self .generate_blocks (fork )
299+
294300 return BlockchainTest .from_test (
295301 base_test = self ,
296302 genesis_environment = self .env ,
@@ -323,11 +329,10 @@ def execute(
323329 execute_format : ExecuteFormat ,
324330 ) -> BaseExecute :
325331 """Execute the benchmark test by sending it to the live network."""
326- del fork
327-
328332 if execute_format == TransactionPost :
333+ blocks = self .generate_blocks (fork )
329334 return TransactionPost (
330- blocks = [[ self . tx ] ],
335+ blocks = [block . txs for block in blocks ],
331336 post = self .post ,
332337 )
333338 raise Exception (f"Unsupported execute format: { execute_format } " )
0 commit comments