From 7a896a6535f70acd2f986ff5711fed1ebc2d963c Mon Sep 17 00:00:00 2001 From: Vesa-Ville Date: Wed, 5 Jul 2023 14:09:02 +0300 Subject: [PATCH] feat: Add missing test for Committee::to_next_round() --- node/narwhal/src/helpers/committee.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/narwhal/src/helpers/committee.rs b/node/narwhal/src/helpers/committee.rs index e68ddaf30b..74d96015ef 100644 --- a/node/narwhal/src/helpers/committee.rs +++ b/node/narwhal/src/helpers/committee.rs @@ -169,6 +169,18 @@ pub mod tests { } } + #[proptest] + fn committee_advance(#[filter(CommitteeInput::is_valid)] input: CommitteeInput) { + let committee = input.to_committee().unwrap(); + let current_round = input.round; + let current_members = committee.members(); + assert_eq!(committee.round(), current_round); + + let committee = committee.to_next_round().unwrap(); + assert_eq!(committee.round(), current_round + 1); + assert_eq!(committee.members(), current_members); + } + #[proptest] fn committee_members(input: CommitteeInput) { let committee = match input.to_committee() {