diff --git a/parachain-consensus/src/lib.rs b/parachain-consensus/src/lib.rs index 58eb04d57..1ae83786f 100644 --- a/parachain-consensus/src/lib.rs +++ b/parachain-consensus/src/lib.rs @@ -27,6 +27,7 @@ pub use pallet::*; #[frame_support::pallet] pub mod pallet { + use super::*; use cumulus_primitives_core::relay_chain; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; @@ -36,7 +37,9 @@ pub mod pallet { pub struct Pallet(_); #[pallet::config] - pub trait Config: frame_system::Config + parachain_system::Config { + pub trait Config: + frame_system::Config + pallet_ismp::Config + parachain_system::Config + { type RuntimeEvent: From> + IsType<::RuntimeEvent>; } @@ -64,6 +67,27 @@ pub mod pallet { } } } + + #[pallet::genesis_config] + pub struct GenesisConfig; + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + // insert empty bytes + pallet_ismp::ConsensusStates::::insert( + consensus::PARACHAIN_CONSENSUS_ID, + Vec::::new(), + ); + } + } } /// Interface that exposes the relay chain state roots.