diff --git a/pallets/async-backing/src/lib.rs b/pallets/async-backing/src/lib.rs index 16e606b..e97183b 100644 --- a/pallets/async-backing/src/lib.rs +++ b/pallets/async-backing/src/lib.rs @@ -94,6 +94,11 @@ pub mod pallet { /// A way to get the current parachain slot and verify it's validity against the relay slot. type GetAndVerifySlot: GetAndVerifySlot; + + /// Purely informative, but used by mocking tools like chospticks to allow knowing how to mock + /// blocks + #[pallet::constant] + type ExpectedBlockTime: Get; } /// First tuple element is the highest slot that has been seen in the history of this chain. diff --git a/pallets/async-backing/src/mock.rs b/pallets/async-backing/src/mock.rs index 5a7c437..1ee1972 100644 --- a/pallets/async-backing/src/mock.rs +++ b/pallets/async-backing/src/mock.rs @@ -81,6 +81,7 @@ impl pallet_timestamp::Config for Test { parameter_types! { pub const AllowMultipleBlocksPerSlot: bool = true; pub const SlotDuration: u64 = 12000; + type ExpectedBlockTime = ConstU64<1>; } impl async_backing::Config for Test { diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index b5add33..37d89e6 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -638,9 +638,14 @@ impl pallet_author_slot_filter::Config for Runtime { type WeightInfo = (); } +parameter_types! { + pub const ExpectedBlockTime: u64 = MILLISECS_PER_BLOCK; +} + impl pallet_async_backing::Config for Runtime { type AllowMultipleBlocksPerSlot = ConstBool; type GetAndVerifySlot = pallet_async_backing::RelaySlot; + type ExpectedBlockTime = ExpectedBlockTime; } parameter_types! {