-
Notifications
You must be signed in to change notification settings - Fork 343
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
feat(sns): Extend cast_vote_and_cascade_follow
to take topic-based following into account
#4583
base: master
Are you sure you want to change the base?
Conversation
be9a1b5
to
31e7d12
Compare
@@ -318,6 +325,90 @@ impl Neuron { | |||
Vote::Unspecified | |||
} | |||
|
|||
/// Analogous to `would_follow_ballots`, but for topic-based following. | |||
pub(crate) fn would_topic_follow_ballots( |
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.
pub(crate) fn would_topic_follow_ballots( | |
pub(crate) fn would_follow_ballots_based_on_topic( |
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.
Make this top-level, handle the fallback inside
continue; | ||
}; | ||
|
||
// Supporting topic-based following with legacy (function-based) as fallback. |
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.
From here ...
ballots, | ||
proposal_criticality, | ||
); | ||
} |
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.
... till here, can all go into a dedicated method on Neuron
@@ -3635,9 +3794,16 @@ impl Governance { | |||
// not (directly or indirectly) voted yet). That is, once a neuron is swayed, | |||
// its vote is "locked in". IOW, swaying is "monotonic". | |||
while !induction_votes.is_empty() { | |||
#[derive(Eq, Ord, PartialEq, PartialOrd)] | |||
enum FollowingType { |
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.
This info is most likely not necessary
Try to rewrite without keeping track of the edge type
This PR implements topic-based following, which legacy (function-based) following is kept as a fallback.
< Previous PR |