mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 22:15:40 +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
@@ -28,6 +28,7 @@ sp-io = { path = "../../../substrate/primitives/io", default-features = false }
|
||||
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
|
||||
sp-staking = { path = "../../../substrate/primitives/staking", default-features = false }
|
||||
sp-core = { path = "../../../substrate/primitives/core", default-features = false }
|
||||
sp-genesis-builder = { path = "../../../substrate/primitives/genesis-builder", default-features = false }
|
||||
sp-mmr-primitives = { path = "../../../substrate/primitives/merkle-mountain-range", default-features = false }
|
||||
sp-session = { path = "../../../substrate/primitives/session", default-features = false }
|
||||
sp-version = { path = "../../../substrate/primitives/version", default-features = false }
|
||||
@@ -124,6 +125,7 @@ std = [
|
||||
"serde_derive",
|
||||
"sp-api/std",
|
||||
"sp-core/std",
|
||||
"sp-genesis-builder/std",
|
||||
"sp-io/std",
|
||||
"sp-mmr-primitives/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -42,7 +42,9 @@ use frame_election_provider_support::{
|
||||
onchain, SequentialPhragmen,
|
||||
};
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime,
|
||||
genesis_builder_helper::{build_config, create_default_config},
|
||||
parameter_types,
|
||||
traits::{Everything, KeyOwnerProofSystem, WithdrawReasons},
|
||||
};
|
||||
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
|
||||
@@ -1137,4 +1139,14 @@ sp_api::impl_runtime_apis! {
|
||||
Timestamp::now()
|
||||
}
|
||||
}
|
||||
|
||||
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