mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
chore: move genesis block builder to chain-spec crate. (#13427)
* chore: move genesis block builder to block builder crate. * add missing file * chore: move genesis block builder to sc-chain-spec * Update client/chain-spec/src/genesis.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update test-utils/runtime/src/genesismap.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update test-utils/runtime/client/src/lib.rs * fix warnings * fix warnings --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -30,6 +30,8 @@ pub use substrate_test_runtime as runtime;
|
||||
|
||||
pub use self::block_builder_ext::BlockBuilderExt;
|
||||
|
||||
use sc_chain_spec::construct_genesis_block;
|
||||
use sp_api::StateVersion;
|
||||
use sp_core::{
|
||||
sr25519,
|
||||
storage::{ChildInfo, Storage, StorageChild},
|
||||
@@ -122,7 +124,7 @@ impl GenesisParameters {
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_test_client::GenesisInit for GenesisParameters {
|
||||
impl GenesisInit for GenesisParameters {
|
||||
fn genesis_storage(&self) -> Storage {
|
||||
use codec::Encode;
|
||||
|
||||
@@ -148,7 +150,7 @@ impl substrate_test_client::GenesisInit for GenesisParameters {
|
||||
storage.top.clone().into_iter().chain(child_roots).collect(),
|
||||
sp_runtime::StateVersion::V1,
|
||||
);
|
||||
let block: runtime::Block = client::genesis::construct_genesis_block(state_root);
|
||||
let block: runtime::Block = construct_genesis_block(state_root, StateVersion::V1);
|
||||
storage.top.extend(additional_storage_with_genesis(&block));
|
||||
|
||||
storage
|
||||
@@ -260,7 +262,7 @@ impl<B> TestClientBuilderExt<B>
|
||||
client::LocalCallExecutor<
|
||||
substrate_test_runtime::Block,
|
||||
B,
|
||||
sc_executor::NativeElseWasmExecutor<LocalExecutorDispatch>,
|
||||
NativeElseWasmExecutor<LocalExecutorDispatch>,
|
||||
>,
|
||||
B,
|
||||
> where
|
||||
@@ -288,11 +290,6 @@ pub fn new() -> Client<Backend> {
|
||||
}
|
||||
|
||||
/// Create a new native executor.
|
||||
pub fn new_native_executor() -> sc_executor::NativeElseWasmExecutor<LocalExecutorDispatch> {
|
||||
sc_executor::NativeElseWasmExecutor::new(
|
||||
sc_executor::WasmExecutionMethod::Interpreted,
|
||||
None,
|
||||
8,
|
||||
2,
|
||||
)
|
||||
pub fn new_native_executor() -> NativeElseWasmExecutor<LocalExecutorDispatch> {
|
||||
NativeElseWasmExecutor::new(sc_executor::WasmExecutionMethod::Interpreted, None, 8, 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user