Skip to content
Permalink
Browse files

add handy accessors to the Leadership object

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 a2db307b6c81ee3d12ba7cbd566f1c74086621e7
Showing with 12 additions and 0 deletions.
  1. +12 −0 chain-impl-mockchain/src/leadership/mod.rs
@@ -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 {

0 comments on commit a2db307

Please sign in to comment.
You can’t perform that action at this time.