Skip to content

Commit

Permalink
Updates bft unit test for garbage collection
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelle1 committed Mar 24, 2024
1 parent e546d08 commit 0f599ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions node/bft/src/bft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,11 +1205,11 @@ mod tests {
let max_gc_rounds = 1;
let committee_round = 0;
let commit_round = 2;
let current_round = commit_round + 1;
let next_round = commit_round + 1;

// Sample the certificates.
let (_, certificates) = snarkvm::ledger::narwhal::batch_certificate::test_helpers::sample_batch_certificate_with_previous_certificates(
current_round,
next_round,
rng,
);

Expand Down Expand Up @@ -1257,8 +1257,11 @@ mod tests {
// Commit the leader certificate.
bft.commit_leader_certificate::<false>(leader_certificate, Default::default()).await.unwrap();

// Increment the BFT to the next round.
let _next_round = bft.storage().increment_to_next_round(commit_round);

// Ensure that the `gc_round` has been updated.
assert_eq!(bft.storage().gc_round(), commit_round - max_gc_rounds);
assert_eq!(bft.storage().gc_round(), next_round - max_gc_rounds);

Ok(())
}
Expand Down

0 comments on commit 0f599ef

Please sign in to comment.