Skip to content

Commit

Permalink
consensus: Resolve unit-test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk committed Nov 23, 2023
1 parent c447f22 commit c14e0c6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions consensus/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ mod tests {
// Last member's vote should reach the quorum
if i == winning_index {
// (hash, sv) is only returned in case we reach the quorum
let (hash, sv) = a
let (hash, sv, quorum_reached) = a
.collect_vote(&c, h, signature)
.expect("failed to reach quorum");

assert_eq!(quorum_reached, true, "quorum should be reached");

// Check expected block hash
assert_eq!(hash, block_hash);

Expand All @@ -307,7 +309,14 @@ mod tests {
}

// Check collected votes
assert!(a.collect_vote(&c, h, signature).is_none());
let (_, _, quorum_reached) =
a.collect_vote(&c, h, signature).unwrap();

assert_eq!(
quorum_reached, false,
"quorum should not be reached yet"
);

collected_votes += expected_votes[i];
assert_eq!(a.get_total(h.step, block_hash), Some(collected_votes));

Expand Down

0 comments on commit c14e0c6

Please sign in to comment.