@@ -42,7 +42,7 @@ use node_primitives::Block;
42
42
use sc_block_builder:: BlockBuilderProvider ;
43
43
use sc_client_api:: {
44
44
execution_extensions:: { ExecutionExtensions , ExecutionStrategies } ,
45
- ExecutionStrategy ,
45
+ BlockBackend , ExecutionStrategy ,
46
46
} ;
47
47
use sc_client_db:: PruningMode ;
48
48
use sc_consensus:: { BlockImport , BlockImportParams , ForkChoiceStrategy , ImportResult , ImportedAux } ;
@@ -54,7 +54,7 @@ use sp_core::{blake2_256, ed25519, sr25519, traits::SpawnNamed, ExecutionContext
54
54
use sp_inherents:: InherentData ;
55
55
use sp_runtime:: {
56
56
generic:: BlockId ,
57
- traits:: { Block as BlockT , IdentifyAccount , Verify } ,
57
+ traits:: { Block as BlockT , IdentifyAccount , Verify , Zero } ,
58
58
OpaqueExtrinsic ,
59
59
} ;
60
60
@@ -273,12 +273,15 @@ pub struct BlockContentIterator<'a> {
273
273
274
274
impl < ' a > BlockContentIterator < ' a > {
275
275
fn new ( content : BlockContent , keyring : & ' a BenchKeyring , client : & Client ) -> Self {
276
- let genesis_hash = client. chain_info ( ) . genesis_hash ;
277
-
278
276
let runtime_version = client
279
- . runtime_version_at ( genesis_hash )
277
+ . runtime_version_at ( & BlockId :: number ( 0 ) )
280
278
. expect ( "There should be runtime version at 0" ) ;
281
279
280
+ let genesis_hash = client
281
+ . block_hash ( Zero :: zero ( ) )
282
+ . expect ( "Database error?" )
283
+ . expect ( "Genesis block always exists; qed" ) ;
284
+
282
285
BlockContentIterator { iteration : 0 , content, keyring, runtime_version, genesis_hash }
283
286
}
284
287
}
0 commit comments