Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Revert "add generic parameter to support different runtimes"
This reverts commit 4405ea9.
  • Loading branch information
0x8f701 committed Oct 22, 2021
commit 0c01dda34571ca7b5708077d42a256f67771b312
24 changes: 6 additions & 18 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
registrar: westend_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v1::LOWEST_PUBLIC_ID,
},
xcm_pallet: westend_runtime::XcmPalletConfig {
safe_xcm_version: Some(2),
..Default::default()
},
xcm_pallet: westend_runtime::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down Expand Up @@ -759,7 +756,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
},
gilt: Default::default(),
paras: Default::default(),
xcm_pallet: kusama::XcmPalletConfig { safe_xcm_version: Some(2), ..Default::default() },
xcm_pallet: kusama::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down Expand Up @@ -1059,10 +1056,7 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
registrar: rococo_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v1::LOWEST_PUBLIC_ID,
},
xcm_pallet: rococo_runtime::XcmPalletConfig {
safe_xcm_version: Some(2),
..Default::default()
},
xcm_pallet: rococo_runtime::XcmPalletConfig { safe_xcm_version: Some(2) },
// bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
// owner: Some(endowed_accounts[0].clone()),
// ..Default::default()
Expand Down Expand Up @@ -1420,7 +1414,7 @@ pub fn kusama_testnet_genesis(
},
gilt: Default::default(),
paras: Default::default(),
xcm_pallet: kusama::XcmPalletConfig { safe_xcm_version: Some(2), ..Default::default() },
xcm_pallet: kusama::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down Expand Up @@ -1502,10 +1496,7 @@ pub fn westend_testnet_genesis(
registrar: westend_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v1::LOWEST_PUBLIC_ID,
},
xcm_pallet: westend_runtime::XcmPalletConfig {
safe_xcm_version: Some(2),
..Default::default()
},
xcm_pallet: westend_runtime::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down Expand Up @@ -1582,10 +1573,7 @@ pub fn rococo_testnet_genesis(
registrar: rococo_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v1::LOWEST_PUBLIC_ID,
},
xcm_pallet: rococo_runtime::XcmPalletConfig {
safe_xcm_version: Some(2),
..Default::default()
},
xcm_pallet: rococo_runtime::XcmPalletConfig { safe_xcm_version: Some(2) },
// bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
// owner: Some(root_key.clone()),
// ..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ construct_runtime! {
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>} = 73,

// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 99,
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ construct_runtime! {
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>},

// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 99,

}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ construct_runtime! {
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>} = 64,

// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 99,
}
}

Expand Down
9 changes: 4 additions & 5 deletions xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,21 +388,20 @@ pub mod pallet {
StorageValue<_, VersionMigrationStage, OptionQuery>;

#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub struct GenesisConfig {
/// The default version to encode outgoing XCM messages with.
pub safe_xcm_version: Option<XcmVersion>,
pub phantom: sp_std::marker::PhantomData<T>,
}

#[cfg(feature = "std")]
impl<T: Config> Default for GenesisConfig<T> {
impl Default for GenesisConfig {
fn default() -> Self {
Self { safe_xcm_version: Some(XCM_VERSION), phantom: Default::default() }
Self { safe_xcm_version: Some(XCM_VERSION) }
}
}

#[pallet::genesis_build]
impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
impl<T: Config> GenesisBuild<T> for GenesisConfig {
fn build(&self) {
SafeXcmVersion::<T>::set(self.safe_xcm_version);
}
Expand Down
4 changes: 0 additions & 4 deletions xcm/pallet-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,6 @@ pub(crate) fn new_test_ext_with_balances(
.assimilate_storage(&mut t)
.unwrap();

pallet_xcm::GenesisConfig::<Test> { safe_xcm_version: Some(2), ..Default::default() }
.assimilate_storage(&mut t)
.unwrap();

let mut ext = sp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext
Expand Down