mirror of https://github.com/poanetwork/hbbft.git
Add a few explaining comments.
This commit is contained in:
parent
b8a2463d1c
commit
ab89dabde9
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue