From f6ab8b73b6c67e718be6a94485704fcca01980ab Mon Sep 17 00:00:00 2001 From: Abhishek Shah Date: Tue, 9 Jan 2024 12:40:06 +0530 Subject: [PATCH] fix : genesis build_config --- Cargo.lock | 2 ++ Cargo.toml | 1 + runtime/devnet/Cargo.toml | 2 ++ runtime/devnet/src/lib.rs | 11 +++++++++++ runtime/mainnet/Cargo.toml | 2 ++ runtime/mainnet/src/lib.rs | 11 +++++++++++ zombienet.sh | 4 ++-- 7 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c40e19..ea3e9b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2698,6 +2698,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", + "sp-genesis-builder", "sp-inherents", "sp-offchain", "sp-runtime", @@ -5449,6 +5450,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", + "sp-genesis-builder", "sp-inherents", "sp-offchain", "sp-runtime", diff --git a/Cargo.toml b/Cargo.toml index 33d420b..da9175b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,6 +84,7 @@ sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0" } sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0", default-features = false } sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0", default-features = false } sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0", default-features = false } sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0", default-features = false } sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.5.0" } diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 6f39713..bc95859 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -58,6 +58,7 @@ sp-api = { workspace = true, default-features = false } sp-block-builder = { workspace = true, default-features = false } sp-consensus-aura = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } +sp-genesis-builder = { workspace = true, default-features = false } sp-inherents = { workspace = true, default-features = false } sp-offchain = { workspace = true, default-features = false } sp-runtime = { workspace = true, default-features = false } @@ -137,6 +138,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", diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index d68d09f..0ed0514 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -31,6 +31,7 @@ use frame_support::traits::fungible::HoldConsideration; use frame_support::traits::LinearStoragePrice; use frame_support::{ construct_runtime, derive_impl, + genesis_builder_helper::{build_config, create_default_config}, dispatch::DispatchClass, parameter_types, traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse}, @@ -807,6 +808,16 @@ impl_runtime_apis! { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + build_config::(config) + } + } + impl sp_api::Metadata for Runtime { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) diff --git a/runtime/mainnet/Cargo.toml b/runtime/mainnet/Cargo.toml index 0140325..e7878e1 100644 --- a/runtime/mainnet/Cargo.toml +++ b/runtime/mainnet/Cargo.toml @@ -58,6 +58,7 @@ sp-api = { workspace = true, default-features = false } sp-block-builder = { workspace = true, default-features = false } sp-consensus-aura = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } +sp-genesis-builder = { workspace = true, default-features = false } sp-inherents = { workspace = true, default-features = false } sp-offchain = { workspace = true, default-features = false } sp-runtime = { workspace = true, default-features = false } @@ -137,6 +138,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", diff --git a/runtime/mainnet/src/lib.rs b/runtime/mainnet/src/lib.rs index 778a322..e08ef7f 100644 --- a/runtime/mainnet/src/lib.rs +++ b/runtime/mainnet/src/lib.rs @@ -31,6 +31,7 @@ use frame_support::traits::fungible::HoldConsideration; use frame_support::traits::{Contains, LinearStoragePrice}; use frame_support::{ construct_runtime, derive_impl, + genesis_builder_helper::{build_config, create_default_config}, dispatch::DispatchClass, parameter_types, traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse}, @@ -808,6 +809,16 @@ impl_runtime_apis! { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + build_config::(config) + } + } + impl sp_api::Metadata for Runtime { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) diff --git a/zombienet.sh b/zombienet.sh index e2682c1..f21bca4 100755 --- a/zombienet.sh +++ b/zombienet.sh @@ -1,7 +1,7 @@ #!/bin/bash -ZOMBIENET_V=v1.3.68 -POLKADOT_V=v1.1.0 +ZOMBIENET_V=v1.3.69 +POLKADOT_V=v1.5.0 case "$(uname -s)" in Linux*) MACHINE=Linux;;