-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Treasurer to SchedulerOrigin #1325
Conversation
This doesn't seem inherently wrong, but we already have a solution for this, namely the |
@@ -215,7 +215,8 @@ impl pallet_scheduler::Config for Runtime { | |||
type MaximumWeight = MaximumSchedulerWeight; | |||
// The goal of having ScheduleOrigin include AuctionAdmin is to allow the auctions track of | |||
// OpenGov to schedule periodic auctions. | |||
type ScheduleOrigin = EitherOf<EnsureRoot<AccountId>, AuctionAdmin>; | |||
// Also allow Treasurer to schedule recurring payments. | |||
type ScheduleOrigin = EitherOf<EitherOf<EnsureRoot<AccountId>, AuctionAdmin>, Treasurer>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems more readable since root is "special" although perhaps the tracks should go into a tuple to avoid further EitherOf
nesting?
type ScheduleOrigin = EitherOf<EitherOf<EnsureRoot<AccountId>, AuctionAdmin>, Treasurer>; | |
type ScheduleOrigin = EitherOf<EnsureRoot<AccountId>, EitherOf<Treasurer, AuctionAdmin>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on tuple, this is much more readable:
type ScheduleOrigin = EitherOf<EitherOf<EnsureRoot<AccountId>, AuctionAdmin>, Treasurer>; | |
type ScheduleOrigin = (EnsureRoot<AccountId>, AuctionAdmin, Treasurer); |
However, I just took a look and realized that EnsureOrigin
doesn't have implementations on tuples, so we can't write this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine as Treasurer is controllable by governance only.
This means it will be possible to schedule recurring payments using Treasurer track.
Original PR paritytech/polkadot#7637