Skip to content

Commit

Permalink
Change pallet naming in test-runtime (#3551)
Browse files Browse the repository at this point in the history
* Change pallet naming in test-runtime

This is required to make the `well_know_keys::ACTIVE_CONFIG` match the
`ActiveConfig` key.

* Use correct name

* 🤦
  • Loading branch information
bkchr committed Aug 2, 2021
1 parent ff5d56f commit 2cfda98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion polkadot/node/test/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn polkadot_testnet_genesis(
claims: runtime::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: runtime::VestingConfig { vesting: vec![] },
sudo: runtime::SudoConfig { key: root_key },
parachains_configuration: runtime::ParachainsConfigurationConfig {
configuration: runtime::ConfigurationConfig {
config: polkadot_runtime_parachains::configuration::HostConfiguration {
validation_upgrade_frequency: 10u32,
validation_upgrade_delay: 5,
Expand Down
12 changes: 12 additions & 0 deletions polkadot/runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,18 @@ pub mod pallet {
Ok(())
}
}

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn integrity_test() {
assert_eq!(
&ActiveConfig::<T>::hashed_key(),
primitives::v1::well_known_keys::ACTIVE_CONFIG,
"`well_known_keys::ACTIVE_CONFIG` doesn't match key of `ActiveConfig`! Make sure that the name of the\
configuration pallet is `Configuration` in the runtime!",
);
}
}
}

impl<T: Config> Pallet<T> {
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ construct_runtime! {
Vesting: pallet_vesting::{Pallet, Call, Storage, Event<T>, Config<T>},

// Parachains runtime modules
ParachainsConfiguration: parachains_configuration::{Pallet, Call, Storage, Config<T>},
Configuration: parachains_configuration::{Pallet, Call, Storage, Config<T>},
ParaInclusion: parachains_inclusion::{Pallet, Call, Storage, Event<T>},
ParasInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent},
Initializer: parachains_initializer::{Pallet, Call, Storage},
Expand Down

0 comments on commit 2cfda98

Please sign in to comment.