From b5b42c94b72b368ede7b03b2527fe7ea10d8e304 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Thu, 17 Jun 2021 10:03:10 +0100 Subject: [PATCH] Allow Council to Use Scheduler (#3237) * Allow council to use scheduler * westend doesnt have council --- polkadot/runtime/kusama/src/lib.rs | 8 +++++++- polkadot/runtime/polkadot/src/lib.rs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 62f3b858ce..20c0e590d8 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -200,13 +200,19 @@ parameter_types! { pub const MaxScheduledPerBlock: u32 = 50; } +type ScheduleOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> +>; + impl pallet_scheduler::Config for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; type Call = Call; type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureRoot; + type ScheduleOrigin = ScheduleOrigin; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; } diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index d6f58354d6..b27b089fda 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -184,13 +184,19 @@ parameter_types! { pub const MaxScheduledPerBlock: u32 = 50; } +type ScheduleOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> +>; + impl pallet_scheduler::Config for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; type Call = Call; type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureRoot; + type ScheduleOrigin = ScheduleOrigin; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; }