Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
fix : genesis build_config
Browse files Browse the repository at this point in the history
  • Loading branch information
weezy20 committed Jan 9, 2024
1 parent 96c8f8b commit f6ab8b7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 2 additions & 0 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -807,6 +808,16 @@ impl_runtime_apis! {
}
}

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)
}
}

impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
OpaqueMetadata::new(Runtime::metadata().into())
Expand Down
2 changes: 2 additions & 0 deletions runtime/mainnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -808,6 +809,16 @@ impl_runtime_apis! {
}
}

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)
}
}

impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
OpaqueMetadata::new(Runtime::metadata().into())
Expand Down
4 changes: 2 additions & 2 deletions zombienet.sh
Original file line number Diff line number Diff line change
@@ -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;;
Expand Down

0 comments on commit f6ab8b7

Please sign in to comment.