Add a few explaining comments.

This commit is contained in:
Andreas Fackler 2018-05-19 17:10:30 +02:00
parent b8a2463d1c
commit ab89dabde9
2 changed files with 4 additions and 1 deletions

View File

@ -29,7 +29,7 @@ impl AgreementMessage {
/// Binary Agreement instance
pub struct Agreement<NodeUid> {
/// The UID of the corresponding proposer node.
/// This node's ID.
uid: NodeUid,
num_nodes: usize,
num_faulty_nodes: usize,

View File

@ -44,7 +44,10 @@ fn test_common_subset<A: Adversary<CommonSubset<NodeUid>>>(
expected = Some(node.outputs()[0].clone());
}
let output = expected.unwrap();
// The Common Subset algorithm guarantees that more than two thirds of the proposed elements
// are in the set.
assert!(output.len() * 3 > inputs.len() * 2);
// Verify that the set's elements match the proposed values.
for (id, value) in output {
assert_eq!(inputs[&id], value);
}