Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
add handy accessors to the Leadership object
Browse files Browse the repository at this point in the history
this allows to get the necessary information from the leadership
to check consistency of the leadership
  • Loading branch information
NicolasDP committed May 13, 2019
1 parent 2c9a30e commit a2db307
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chain-impl-mockchain/src/leadership/mod.rs
Expand Up @@ -145,6 +145,18 @@ impl Leadership {
}
}

/// get the epoch associated to the `Leadership`
#[inline]
pub fn epoch(&self) -> Epoch {
self.epoch
}

/// get the TimeEra associated to the `Leadership`
#[inline]
pub fn era(&self) -> &TimeEra {
&self.era
}

/// Verify whether this header has been produced by a leader that fits with the leadership
///
pub fn verify(&self, block_header: &Header) -> Verification {
Expand Down

0 comments on commit a2db307

Please sign in to comment.