Skip to content

Commit

Permalink
refactor(nns): Clarify voting code (#3210)
Browse files Browse the repository at this point in the history
Small change to clarify voting function.
  • Loading branch information
max-dfinity authored Dec 18, 2024
1 parent 5463a88 commit 586c57a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rs/nns/governance/src/voting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ impl Governance {
is_over_soft_limit: fn() -> bool,
) {
let proposal_id = machine.proposal_id;
let Ok(ballots) = proposal_ballots(&mut self.heap_data.proposals, proposal_id.id) else {
eprintln!(
"{} Proposal {} for voting machine not found. Machine cannot complete work.",
LOG_PREFIX, proposal_id.id
);
return;
};

while !machine.is_completely_finished() {
if let Ok(ballots) = proposal_ballots(&mut self.heap_data.proposals, proposal_id.id) {
machine.continue_processing(&mut self.neuron_store, ballots, is_over_soft_limit);
} else {
eprintln!(
"{} Proposal {} for voting machine not found. Machine cannot complete work.",
LOG_PREFIX, proposal_id.id
);
break;
}
machine.continue_processing(&mut self.neuron_store, ballots, is_over_soft_limit);

if is_over_soft_limit() {
break;
Expand Down

0 comments on commit 586c57a

Please sign in to comment.