-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Max class voters for ranked collective vote tally #13313
Conversation
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.
Looks ok in general, but are Rank
and Class
not already defined as equivalent within ranked-collective's VoteTally
impl because its Class
generic parameter is provided as Rank
?
I see it now. substrate/frame/ranked-collective/src/lib.rs Line 343 in 37e3abd
The signatures of the VoteTally funcs impls becomes confusing to me, the name of the arg is class , the type is Rank , but docs will help -substrate/frame/ranked-collective/src/lib.rs Line 140 in 37e3abd
I faced the issue, while trying to define the Class as enum.We can go either way, generic class (like in the PR now) or class type is rank type, but I make it more explicit and add some docs. |
bot rebase |
Rebased |
bot rebase |
Rebased |
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.
Just one comment.
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.
Just one comment.
bot merge |
Waiting for commit status. |
* max class voters for vote tally * fix move * tests * rename to GetMaxVoters * saturating sub --------- Co-authored-by: parity-processbot <>
* max class voters for vote tally * fix move * tests * rename to GetMaxVoters * saturating sub --------- Co-authored-by: parity-processbot <>
The implementation of
VoteTally
trait, usesRank
type whereClass
is supposed.For Kusama runtime, this is not an issue. The
Rank
andClass
is the same u16 type and mapped 1:1.But if,
Class
is any other type (e.g. enum), it wont compile.// DONE tests