feat(committee): add CommitteeMember origin for pallet committee#104
feat(committee): add CommitteeMember origin for pallet committee#104
Conversation
mattsse
left a comment
There was a problem hiding this comment.
The Origin types look great.
But I don't think we need it necessarily need it in the Committee pallet as extra config type, since we can check for inclusion in the Members directly. Because we check for inclusion anyway
pallets/committee/src/lib.rs
Outdated
| let caller = T::ProposalVoteOrigin::ensure_origin(origin)?; | ||
| let voter = CommitteeMember::new( | ||
| caller.clone(), | ||
| <Members<T>>::get(caller).ok_or(<Error<T>>::NotMember)?, | ||
| ); |
There was a problem hiding this comment.
Since only members are allowed to vote, I believe we should only check for inclusion in Members instead adding another origin, which will probably do the same as ensure_member
There was a problem hiding this comment.
ur right LOL, added an origin for Vote created a lot of trouble for me QAQ
But the logic of EnsureMember contains the logic of ensure_member, so I want to remove ensure_member crazily LOL
BTW, I'm not afraid of Origin anymore now hhh
There was a problem hiding this comment.
BTW, I'm not afraid of Origin anymore now hhh
That's awesome !
This is also a confusing thing while I working on this PR, the difference between our But for pallets like How do you like removing |
mattsse
left a comment
There was a problem hiding this comment.
It's intended that anyone can submit a proposal, so this should just be the standard EnsureSigned
You're probably right, however this may change, so my feeling is we should keep the origins in
pallets/committee/src/mock.rs
Outdated
| type MinCouncilVotes = MinCouncilVotes; | ||
| type ProposalSubmissionOrigin = frame_system::EnsureSignedBy<AdminAccountId, AccountId>; | ||
| type ProposalExecutionOrigin = frame_system::EnsureSignedBy<ExecuterAccountId, AccountId>; | ||
| type ProposalSubmissionOrigin = EnsureMember<Self>; |
There was a problem hiding this comment.
This should be EnsureSigned only since, anyone is allowed to submit proposals
| type ProposalSubmissionOrigin = EnsureMember<Self>; | |
| type ProposalSubmissionOrigin = EnsureSigned; |
Changes
EnsureAprovedByCommitteCommitteeMemberoriginTests
Issues
Closes #96