Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moshababo committed Jan 3, 2024
1 parent a214868 commit be1b9c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/libs/roles/src/validator/messages/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ impl PrepareQC {
}

/// Add a validator's signed message.
/// * `signed_message` - A valid signed `ReplicaPrepare` message.
/// * `validator_index` - The signer index in the validator set.
/// * `validator_set` - The validator set.
pub fn add(
&mut self,
signed_message: &Signed<ReplicaPrepare>,
Expand Down Expand Up @@ -292,6 +295,8 @@ impl CommitQC {
}

/// Add a validator's signature.
/// * `sig` - A valid signature.
/// * `validator_index` - The signer index in the validator set.
pub fn add(&mut self, sig: &Signature, validator_index: usize) {
self.signers.0.set(validator_index, true);
self.signature.add(sig);
Expand Down
2 changes: 2 additions & 0 deletions node/libs/roles/src/validator/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ impl PrepareQC {

impl CommitQC {
/// Creates a new CommitQC from a list of *signed* replica Commit messages and the current validator set.
/// * `signed_messages` - A list of valid `ReplicaCommit` signed messages. Must contain at least one item.
/// * `validators` - The validator set.
pub fn from(
signed_messages: &[Signed<ReplicaCommit>],
validators: &ValidatorSet,
Expand Down

0 comments on commit be1b9c5

Please sign in to comment.