Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
mulmarta committed May 3, 2024
1 parent cc7489e commit 5ca3f33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions mls-rs/src/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4330,4 +4330,21 @@ mod tests {
.iter()
.any(|member| member.index() == 0));
}

#[cfg(feature = "by_ref_proposal")]
#[maybe_async::test(not(mls_build_async), async(mls_build_async, crate::futures_test))]
async fn commit_clears_proposals() {
let mut groups = test_n_member_group(TEST_PROTOCOL_VERSION, TEST_CIPHER_SUITE, 2).await;

groups[0].group.propose_update(vec![]).await.unwrap();

assert_eq!(groups[0].group.state.proposals.proposals.len(), 1);
assert_eq!(groups[0].group.state.proposals.own_proposals.len(), 1);

let commit = groups[1].group.commit(vec![]).await.unwrap().commit_message;
groups[0].process_message(commit).await.unwrap();

assert!(groups[0].group.state.proposals.proposals.is_empty());
assert!(groups[0].group.state.proposals.own_proposals.is_empty());
}
}
2 changes: 1 addition & 1 deletion mls-rs/src/group/proposal_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ impl ProposalCache {
}
}

#[inline]
pub fn clear(&mut self) {
self.proposals.clear();
self.own_proposals.clear();
}

#[cfg(feature = "private_message")]
Expand Down

0 comments on commit 5ca3f33

Please sign in to comment.