Skip to content

Commit 8caf3c3

Browse files
committed
chore: add BlockNumberProvider to pallet_scheduler (#518)
chore: add BlockNumberProvider for pallet_scheduler
1 parent c7ad250 commit 8caf3c3

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

runtime/devnet/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ parameter_types! {
532532
}
533533

534534
impl pallet_scheduler::Config for Runtime {
535+
type BlockNumberProvider = System;
535536
#[cfg(feature = "runtime-benchmarks")]
536537
type MaxScheduledPerBlock = ConstU32<512>;
537538
#[cfg(not(feature = "runtime-benchmarks"))]

runtime/mainnet/src/config/utility.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ parameter_types! {
5252
}
5353

5454
impl pallet_scheduler::Config for Runtime {
55+
type BlockNumberProvider = System;
5556
#[cfg(feature = "runtime-benchmarks")]
5657
type MaxScheduledPerBlock = ConstU32<512>;
5758
#[cfg(not(feature = "runtime-benchmarks"))]
@@ -215,6 +216,14 @@ mod tests {
215216
mod scheduler {
216217
use super::*;
217218

219+
#[test]
220+
fn ensure_system_is_block_number_provider() {
221+
assert_eq!(
222+
TypeId::of::<<Runtime as pallet_scheduler::Config>::BlockNumberProvider>(),
223+
TypeId::of::<System>(),
224+
);
225+
}
226+
218227
#[test]
219228
#[cfg(feature = "runtime-benchmarks")]
220229
fn call_queue_per_block_is_limited() {

runtime/testnet/src/config/utility.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ parameter_types! {
5555
}
5656

5757
impl pallet_scheduler::Config for Runtime {
58+
type BlockNumberProvider = System;
5859
#[cfg(feature = "runtime-benchmarks")]
5960
type MaxScheduledPerBlock = ConstU32<512>;
6061
#[cfg(not(feature = "runtime-benchmarks"))]

0 commit comments

Comments
 (0)