cumulus test runtime: remove GenesisExt (#2147)

This PR removes the `GenesisExt` wrapper over the `GenesisRuntimeConfig`
in `cumulus-test-service`. Initialization of values that were performed
by `GenesisExt::BuildStorage` was moved into `test_pallet` genesis.

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Michal Kucharczyk
2023-11-04 10:25:07 +01:00
committed by GitHub
parent 21fbc00d04
commit 1c0b437330
6 changed files with 39 additions and 37 deletions
+5 -5
View File
@@ -76,10 +76,6 @@ impl_opaque_keys! {
pub struct SessionKeys {}
}
/// Some key that we set in genesis and only read in [`TestOnRuntimeUpgrade`] to ensure that
/// [`OnRuntimeUpgrade`] works as expected.
pub const TEST_RUNTIME_UPGRADE_KEY: &[u8] = b"+test_runtime_upgrade_key+";
/// The para-id used in this runtime.
pub const PARACHAIN_ID: u32 = 100;
@@ -293,6 +289,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
}
parameter_types! {
// will be set by test_pallet during genesis init
pub storage ParachainId: cumulus_primitives_core::ParaId = PARACHAIN_ID.into();
}
@@ -367,7 +364,10 @@ pub struct TestOnRuntimeUpgrade;
impl OnRuntimeUpgrade for TestOnRuntimeUpgrade {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
assert_eq!(sp_io::storage::get(TEST_RUNTIME_UPGRADE_KEY), Some(vec![1, 2, 3, 4].into()));
assert_eq!(
sp_io::storage::get(test_pallet::TEST_RUNTIME_UPGRADE_KEY),
Some(vec![1, 2, 3, 4].into())
);
Weight::from_parts(1, 0)
}
}