Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genesis-builder: implemented for all runtimes #1492

Merged
merged 5 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cumulus/parachain-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ sp-api = { path = "../../../substrate/primitives/api", default-features = false}
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}
Expand Down Expand Up @@ -111,6 +112,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",
Expand Down
11 changes: 11 additions & 0 deletions cumulus/parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use sp_version::RuntimeVersion;
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
weights::{
Expand Down Expand Up @@ -742,6 +743,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! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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}
Expand Down Expand Up @@ -209,6 +210,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",
Expand Down
11 changes: 11 additions & 0 deletions cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
ord_parameter_types, parameter_types,
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
Expand Down Expand Up @@ -1340,6 +1341,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! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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}
Expand Down Expand Up @@ -190,6 +191,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",
Expand Down
11 changes: 11 additions & 0 deletions cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
Expand Down Expand Up @@ -1218,6 +1219,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! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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}
Expand Down Expand Up @@ -198,6 +199,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",
Expand Down
11 changes: 11 additions & 0 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
ord_parameter_types, parameter_types,
traits::{
tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32,
Expand Down Expand Up @@ -1353,6 +1354,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! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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-io = { path = "../../../../../substrate/primitives/io", default-features = false}
sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false}
Expand Down Expand Up @@ -118,6 +119,7 @@ std = [
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use sp_version::RuntimeVersion;
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -779,6 +780,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! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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-io = { path = "../../../../../substrate/primitives/io", default-features = false}
sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false}
Expand Down Expand Up @@ -118,6 +119,7 @@ std = [
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
Expand Down
Loading