Skip to content

Commit

Permalink
[encointer] Added sp_genesis_builder::GenesisBuilder to the `Encoin…
Browse files Browse the repository at this point in the history
…ter`
  • Loading branch information
bkontur committed Jan 22, 2024
1 parent f684acd commit b74fa6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system-parachains/encointer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ sp-session = { default-features = false, version = "24.0.0" }
sp-std = { default-features = false, version = "12.0.0" }
sp-transaction-pool = { default-features = false, version = "23.0.0" }
sp-version = { default-features = false, version = "26.0.0" }
sp-genesis-builder = { default-features = false , version = "0.4.0" }

# Polkadot dependencies
pallet-xcm = { default-features = false, version = "4.0.0" }
Expand Down Expand Up @@ -174,6 +175,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 system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub use encointer_primitives::{
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
tokens::{pay::PayFromAccount, ConversionFromAssetBalance, ConversionToAssetBalance},
Expand Down Expand Up @@ -915,6 +916,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)
}
}

#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
Expand Down

0 comments on commit b74fa6e

Please sign in to comment.