-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Introduce default-setting prime for collective #5137
Conversation
let old = Members::<T, I>::get(); | ||
<Self as ChangeMembers<T::AccountId>>::set_members_sorted(&new_members[..], &old); | ||
Prime::<T, I>::set(prime); |
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.
Updating Members
storage with new_members
has been lost with this change.
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.
yeah. that was superfluous logic as it happens anyway in <Self as ChangeMembers<T::AccountId>>::set_members_sorted(&new_members[..], &old)
.
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.
I think this is an issue since other parts of logic rely on Self::members()
which reads from the local members list.
We need some trait to tell the module where to read the correct list of members from, and use it here.
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.
Not sure what you mean. Members
is always kept up to date regardless of how the set is changed.
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
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.
It is a little strange to me that reset_members
keeps prime if they happen to be in the old and new set, but sure, just an implementation detail.
Please review my question above (RE: Members
storage item) before you merge.
* Introduce default-setting prime for collective * Docs. * Elections phragmen supports prime * Fix * Membership supports prime * Fix * Update frame/collective/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Introduce default-setting prime for collective * Docs. * Elections phragmen supports prime * Fix * Membership supports prime * Fix * Update frame/collective/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Allows the existence of a "prime member" of the collective whose vote acts as the default for any other members.
CC @jacogr