mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 15:21:08 +00:00
genesis-builder: implemented for all runtimes (#1492)
This PR implements [`GenesisBuilder` API](https://github.com/paritytech/polkadot-sdk/blob/a414ea7515c9cdc81f1d12410e646afc148250e8/substrate/primitives/genesis-builder/src/lib.rs#L38) for all the runtimes in polkadot repo. Step towards: paritytech/polkadot-sdk#25 --------- Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
committed by
GitHub
parent
ab3a3bc278
commit
5a2833cceb
@@ -39,6 +39,7 @@ sp-std = { path = "../../../primitives/std", default-features = false}
|
||||
sp-storage = { path = "../../../primitives/storage", default-features = false}
|
||||
sp-transaction-pool = { path = "../../../primitives/transaction-pool", default-features = false}
|
||||
sp-version = { path = "../../../primitives/version", default-features = false}
|
||||
sp-genesis-builder = { version = "0.1.0-dev", default-features = false, path = "../../../primitives/genesis-builder" }
|
||||
|
||||
# Used for the node template's RPCs
|
||||
frame-system-rpc-runtime-api = { path = "../../../frame/system/rpc/runtime-api", default-features = false}
|
||||
@@ -79,6 +80,7 @@ std = [
|
||||
"sp-consensus-aura/std",
|
||||
"sp-consensus-grandpa/std",
|
||||
"sp-core/std",
|
||||
"sp-genesis-builder/std",
|
||||
"sp-inherents/std",
|
||||
"sp-offchain/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -23,6 +23,7 @@ use sp_std::prelude::*;
|
||||
use sp_version::NativeVersion;
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
use frame_support::genesis_builder_helper::{build_config, create_default_config};
|
||||
// A few exports that help ease life for downstream crates.
|
||||
pub use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
@@ -571,4 +572,14 @@ impl_runtime_apis! {
|
||||
Executive::try_execute_block(block, state_root_check, signature_check, select).expect("execute-block failed")
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
|
||||
fn create_default_config() -> Vec<u8> {
|
||||
create_default_config::<RuntimeGenesisConfig>()
|
||||
}
|
||||
|
||||
fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
|
||||
build_config::<RuntimeGenesisConfig>(config)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user