mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +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
@@ -24,6 +24,7 @@ sp-api = { path = "../../../../../substrate/primitives/api", default-features =
|
||||
sp-block-builder = { path = "../../../../../substrate/primitives/block-builder", default-features = false}
|
||||
sp-consensus-aura = { path = "../../../../../substrate/primitives/consensus/aura", default-features = false }
|
||||
sp-core = { path = "../../../../../substrate/primitives/core", default-features = false}
|
||||
sp-genesis-builder = { path = "../../../../../substrate/primitives/genesis-builder", default-features = false }
|
||||
sp-inherents = { path = "../../../../../substrate/primitives/inherents", default-features = false}
|
||||
sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false}
|
||||
sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false}
|
||||
@@ -91,6 +92,7 @@ std = [
|
||||
"sp-block-builder/std",
|
||||
"sp-consensus-aura/std",
|
||||
"sp-core/std",
|
||||
"sp-genesis-builder/std",
|
||||
"sp-inherents/std",
|
||||
"sp-offchain/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -64,6 +64,7 @@ use sp_version::RuntimeVersion;
|
||||
pub use frame_support::{
|
||||
construct_runtime,
|
||||
dispatch::DispatchClass,
|
||||
genesis_builder_helper::{build_config, create_default_config},
|
||||
parameter_types,
|
||||
traits::{
|
||||
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, IsInVec, Randomness,
|
||||
@@ -452,6 +453,16 @@ impl_runtime_apis! {
|
||||
Ok(batches)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cumulus_pallet_parachain_system::register_validate_block! {
|
||||
|
||||
Reference in New Issue
Block a user