Skip to content

Commit

Permalink
Few more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Oct 24, 2023
1 parent ddd0d8d commit e28625f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Code/common/src/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ use core::fmt::Debug;

// TODO: Keep the trait or just add the bounds to Consensus::Height?
/// Defines the requirements for a height type.
///
/// A height denotes the number of blocks (values) created since the chain began.
///
/// A height of 0 represents a chain which has not yet produced a block.
pub trait Height
where
// TODO: Require Copy as well?
Expand Down
6 changes: 5 additions & 1 deletion Code/common/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ use crate::{Consensus, Round, Value};
/// A type of vote.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum VoteType {
/// Votes for values which validators observe are valid for a given round.
Prevote,

/// Votes to commit to a particular value for a given round.
Precommit,
}

/// Defines the requirements for a vote.
///
/// A vote is a signed message that is sent by a validator to the network.
/// Votes are signed messages from validators for a particular value which
/// include information about the validator signing it.
pub trait Vote<C: Consensus>
where
Self: Clone + Debug + PartialEq + Eq,
Expand Down

0 comments on commit e28625f

Please sign in to comment.