mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Support custom genesis block (#12291)
* Set genesis block data using the built genesis block * Make resolve_state_version_from_wasm a separate function and some small refactorings Useful for the commit following. * Introduce trait BuildGenesisBlock Substrate users can use this trait to implement their custom genesis block when constructing the client. * Make call_executor test compile * cargo +nightly fmt --all * Fix test * Remove unnecessary clone * FMT * Apply review suggestions * Revert changes to new_full_client() and new_full_parts() signature * Remove needless `Block` type in `resolve_state_version_from_wasm`
This commit is contained in:
@@ -397,24 +397,34 @@ impl BenchDb {
|
||||
let task_executor = TaskExecutor::new();
|
||||
|
||||
let backend = sc_service::new_db_backend(db_config).expect("Should not fail");
|
||||
let executor = NativeElseWasmExecutor::new(
|
||||
WasmExecutionMethod::Compiled {
|
||||
instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
|
||||
},
|
||||
None,
|
||||
8,
|
||||
2,
|
||||
);
|
||||
let client_config = sc_service::ClientConfig::default();
|
||||
let genesis_block_builder = sc_service::GenesisBlockBuilder::new(
|
||||
&keyring.generate_genesis(),
|
||||
!client_config.no_genesis,
|
||||
backend.clone(),
|
||||
executor.clone(),
|
||||
)
|
||||
.expect("Failed to create genesis block builder");
|
||||
|
||||
let client = sc_service::new_client(
|
||||
backend.clone(),
|
||||
NativeElseWasmExecutor::new(
|
||||
WasmExecutionMethod::Compiled {
|
||||
instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
|
||||
},
|
||||
None,
|
||||
8,
|
||||
2,
|
||||
),
|
||||
&keyring.generate_genesis(),
|
||||
executor,
|
||||
genesis_block_builder,
|
||||
None,
|
||||
None,
|
||||
ExecutionExtensions::new(profile.into_execution_strategies(), None, None),
|
||||
Box::new(task_executor.clone()),
|
||||
None,
|
||||
None,
|
||||
Default::default(),
|
||||
client_config,
|
||||
)
|
||||
.expect("Should not fail");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user