Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Reset rounds on new validator set. (#133)
Browse files Browse the repository at this point in the history
* Re-set rounds on new validator set.

* Fix docs.
  • Loading branch information
tomusdrw authored Apr 1, 2021
1 parent 9609199 commit b080a7d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion primitives/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,24 @@ pub const BEEFY_ENGINE_ID: sp_runtime::ConsensusEngineId = *b"BEEF";
pub type ValidatorSetId = u64;

/// A set of BEEFY authorities, a.k.a. validators.
#[derive(Decode, Encode, Debug, PartialEq)]
#[derive(Decode, Encode, Debug, PartialEq, Clone)]
pub struct ValidatorSet<AuthorityId> {
/// Public keys of the validator set elements
pub validators: Vec<AuthorityId>,
/// Identifier of the validator set
pub id: ValidatorSetId,
}

impl<AuthorityId> ValidatorSet<AuthorityId> {
/// Return an empty validator set with id of 0.
pub fn empty() -> Self {
Self {
validators: Default::default(),
id: Default::default(),
}
}
}

/// The index of an authority.
pub type AuthorityIndex = u32;

Expand Down

0 comments on commit b080a7d

Please sign in to comment.