Skip to content

Commit

Permalink
chore: rename arg on counting pass (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehrbod2002 authored and JakeHartnell committed Jul 9, 2023
1 parent 5cfb3bf commit a2985ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/dao-voting/src/threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum ThresholdError {
/// If a user specifies a 60% passing threshold, and there are 10
/// voters they likely expect that proposal to pass when there are 6
/// yes votes. This implies that the condition for passing should be
/// `yes_votes >= total_votes * threshold`.
/// `vote_weights >= total_votes * threshold`.
///
/// With this in mind, how should a user specify that they would like
/// proposals to pass if the majority of voters choose yes? Selecting
Expand Down
6 changes: 3 additions & 3 deletions packages/dao-voting/src/voting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn compare_vote_count(
}

pub fn does_vote_count_pass(
yes_votes: Uint128,
vote_weights: Uint128,
options: Uint128,
percent: PercentageThreshold,
) -> bool {
Expand All @@ -96,9 +96,9 @@ pub fn does_vote_count_pass(
return false;
}
match percent {
PercentageThreshold::Majority {} => yes_votes.full_mul(2u64) > options.into(),
PercentageThreshold::Majority {} => vote_weights.full_mul(2u64) > options.into(),
PercentageThreshold::Percent(percent) => {
compare_vote_count(yes_votes, VoteCmp::Geq, options, percent)
compare_vote_count(vote_weights, VoteCmp::Geq, options, percent)
}
}
}
Expand Down

0 comments on commit a2985ab

Please sign in to comment.