Allow Council to Use Scheduler (#3237)

* Allow council to use scheduler

* westend doesnt have council
This commit is contained in:
Shawn Tabrizi
2021-06-17 10:03:10 +01:00
committed by GitHub
parent 0282ad3128
commit b5b42c94b7
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -200,13 +200,19 @@ parameter_types! {
pub const MaxScheduledPerBlock: u32 = 50; pub const MaxScheduledPerBlock: u32 = 50;
} }
type ScheduleOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>
>;
impl pallet_scheduler::Config for Runtime { impl pallet_scheduler::Config for Runtime {
type Event = Event; type Event = Event;
type Origin = Origin; type Origin = Origin;
type PalletsOrigin = OriginCaller; type PalletsOrigin = OriginCaller;
type Call = Call; type Call = Call;
type MaximumWeight = MaximumSchedulerWeight; type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>; type ScheduleOrigin = ScheduleOrigin;
type MaxScheduledPerBlock = MaxScheduledPerBlock; type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>; type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
} }
+7 -1
View File
@@ -184,13 +184,19 @@ parameter_types! {
pub const MaxScheduledPerBlock: u32 = 50; pub const MaxScheduledPerBlock: u32 = 50;
} }
type ScheduleOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>
>;
impl pallet_scheduler::Config for Runtime { impl pallet_scheduler::Config for Runtime {
type Event = Event; type Event = Event;
type Origin = Origin; type Origin = Origin;
type PalletsOrigin = OriginCaller; type PalletsOrigin = OriginCaller;
type Call = Call; type Call = Call;
type MaximumWeight = MaximumSchedulerWeight; type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>; type ScheduleOrigin = ScheduleOrigin;
type MaxScheduledPerBlock = MaxScheduledPerBlock; type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>; type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
} }