Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Add safe_xcm_version to Genesis Specs (#743)
Browse files Browse the repository at this point in the history
* add safe_xcm_version to genesis specs

* cargo +nightly fmt
  • Loading branch information
apopiak authored and gilescope committed Jan 14, 2022
1 parent 60c3ccf commit 72cb9fc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
12 changes: 12 additions & 0 deletions polkadot-parachains/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub type ShellChainSpec = sc_service::GenericChainSpec<shell_runtime::GenesisCon
pub type SeedlingChainSpec =
sc_service::GenericChainSpec<seedling_runtime::GenesisConfig, Extensions>;

/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = 2;

/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
Expand Down Expand Up @@ -392,6 +395,9 @@ fn statemint_genesis(
aura: Default::default(),
aura_ext: Default::default(),
parachain_system: Default::default(),
polkadot_xcm: statemint_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
}
}

Expand Down Expand Up @@ -576,6 +582,9 @@ fn statemine_genesis(
aura: Default::default(),
aura_ext: Default::default(),
parachain_system: Default::default(),
polkadot_xcm: statemine_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
}
}

Expand Down Expand Up @@ -755,5 +764,8 @@ fn westmint_genesis(
aura: Default::default(),
aura_ext: Default::default(),
parachain_system: Default::default(),
polkadot_xcm: westmint_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
}
}
1 change: 1 addition & 0 deletions polkadot-parachains/statemine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-uniques/std",
"pallet-utility/std",
"pallet-xcm/std",
"parachain-info/std",
"cumulus-pallet-aura-ext/std",
"pallet-asset-tx-payment/std",
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachains/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ construct_runtime!(

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,

Expand Down
1 change: 1 addition & 0 deletions polkadot-parachains/statemint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-uniques/std",
"pallet-utility/std",
"pallet-xcm/std",
"parachain-info/std",
"cumulus-pallet-aura-ext/std",
"pallet-asset-tx-payment/std",
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachains/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ construct_runtime!(

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,

Expand Down
1 change: 1 addition & 0 deletions polkadot-parachains/westmint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-uniques/std",
"pallet-utility/std",
"pallet-xcm/std",
"parachain-info/std",
"cumulus-pallet-aura-ext/std",
"pallet-asset-tx-payment/std",
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachains/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ construct_runtime!(

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,

Expand Down

0 comments on commit 72cb9fc

Please sign in to comment.