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

Include submitting origin in PollStatus #4961

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

olanod
Copy link
Contributor

@olanod olanod commented Jul 6, 2024

Adding a Who parameter to the PollStatus::Ongoing variant is a simple change that provides more context to "pollsters" who might be interested in knowing what origin is going to execute a given call.

@olanod olanod force-pushed the polling-ref-provides-origin branch from 3a90bfd to 8e23940 Compare July 8, 2024 17:28
@olanod olanod marked this pull request as ready for review July 9, 2024 00:39
@olanod olanod requested a review from a team as a code owner July 9, 2024 00:39
@@ -59,9 +59,12 @@ impl pallet_balances::Config for Test {
type AccountStore = System;
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Who;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make the type generic over AccountId? This can later be T::AccountId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "who" is not relevant for conviction voting so in this tests I just added a simple struct as placeholder, this struct is not used in the actual implementation of Polling in pallet referenda where it's set as the runtime origin. Perhaps I don't get your point on why Who would need to accept a generic field or is it in the TestPollState where you suggest the generic parameter? anyway let me know to clarify :)

None,
Ongoing(Tally, Class),
Ongoing(Tally, Class, Who),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this origin.

@@ -85,6 +85,7 @@ pub trait Polling<Tally> {
type Index: Parameter + Member + Ord + PartialOrd + Copy + HasCompact + MaxEncodedLen;
type Votes: Parameter + Member + Ord + PartialOrd + Copy + HasCompact + MaxEncodedLen;
type Class: Parameter + Member + Ord + PartialOrd + MaxEncodedLen;
type Who;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Also while there is not yet docs, we should start :D Maybe add a doc explaining this.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6697742

@bkchr
Copy link
Member

bkchr commented Feb 20, 2025

@olanod are you still interested in this or can we close it?

@olanod olanod force-pushed the polling-ref-provides-origin branch from 4750e01 to f6b26e4 Compare February 23, 2025 15:54
@paritytech-review-bot paritytech-review-bot bot requested a review from a team February 23, 2025 15:55
@olanod olanod force-pushed the polling-ref-provides-origin branch from f6b26e4 to 9a7c812 Compare February 23, 2025 16:09
@olanod
Copy link
Contributor Author

olanod commented Feb 23, 2025

@olanod are you still interested in this or can we close it?

Sorry I forgot about the who->origin suggestion. It's still relevant! even more now that it seems iterable tracks will be merged and we won't need our own fork of the sdk :)

@olanod olanod force-pushed the polling-ref-provides-origin branch from 9a7c812 to f50beaa Compare February 23, 2025 16:19
@bkchr bkchr added the T2-pallets This PR/Issue is related to a particular pallet. label Feb 24, 2025
Completed(Moment, bool),
}

impl<Tally, Moment, Class> PollStatus<Tally, Moment, Class> {
pub fn ensure_ongoing(self) -> Option<(Tally, Class)> {
impl<Tally, Moment, Class, Origin> PollStatus<Tally, Moment, Class, Origin> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually thinking about this again, maybe we should introduce some DispatchablePollStatus: PollStatus that only gives you the origin.

There can be polls that are not dispatchables and then you would not have an Origin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants