Skip to content
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

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Conversation

xlc
Copy link
Contributor

@xlc xlc commented Aug 31, 2023

This means it will be possible to schedule recurring payments using Treasurer track.

Original PR paritytech/polkadot#7637

@bkchr bkchr added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Aug 31, 2023
@joepetrowski
Copy link
Contributor

This doesn't seem inherently wrong, but we already have a solution for this, namely the valid_from field in the PR to update Treasury to use multiple types of assets. Just needs to be ported over to the new repo. (cc @muharem )

@@ -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>;
Copy link
Contributor

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?

Suggested change
type ScheduleOrigin = EitherOf<EitherOf<EnsureRoot<AccountId>, AuctionAdmin>, Treasurer>;
type ScheduleOrigin = EitherOf<EnsureRoot<AccountId>, EitherOf<Treasurer, AuctionAdmin>>;

Copy link
Contributor

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:

Suggested change
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.

Copy link
Member

@gavofyork gavofyork left a 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.

@bkchr bkchr merged commit be761b7 into paritytech:master Sep 4, 2023
101 of 104 checks passed
@xlc xlc deleted the update-scheduler branch September 4, 2023 18:28
Ank4n pushed a commit that referenced this pull request Sep 8, 2023
Daanvdplas pushed a commit that referenced this pull request Sep 11, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants