From 867ce1ee78db327e9b5ec9583be8d33f6f24b07d Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 14 Jun 2021 10:21:31 +0100 Subject: [PATCH 1/2] Allow council to use scheduler --- runtime/kusama/src/lib.rs | 8 +++++++- runtime/polkadot/src/lib.rs | 8 +++++++- runtime/westend/src/lib.rs | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 668379c1a0ed..674aab6f9bd1 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -198,13 +198,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/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index e99491783f6d..1db00d9fe8e8 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -183,13 +183,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/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 36d457ce21b3..0ad88903fc94 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -189,13 +189,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; } From 6b7bdb5d1fc192632db8df231afdb5e57f22faa9 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 14 Jun 2021 12:33:59 +0100 Subject: [PATCH 2/2] westend doesnt have council --- runtime/westend/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 0ad88903fc94..36d457ce21b3 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -189,19 +189,13 @@ 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 = ScheduleOrigin; + type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; }