Struct chain_impl_mockchain::leadership::bft::LeadershipData
source · pub struct LeadershipData {
pub(crate) leaders: Arc<[BftLeaderId]>,
}
Expand description
The BFT Leader selection is based on a round robin of the expected leaders
Fields§
§leaders: Arc<[BftLeaderId]>
Implementations§
source§impl LeadershipData
impl LeadershipData
sourcepub fn new(leaders: Arc<[BftLeaderId]>) -> Option<Self>
pub fn new(leaders: Arc<[BftLeaderId]>) -> Option<Self>
Create a new BFT leadership
pub fn number_of_leaders(&self) -> usize
pub fn leaders(&self) -> &[BftLeaderId]
fn offset(&self, block_number: u64) -> BftRoundRobinIndex
pub(crate) fn verify(&self, block_header: &Header) -> Verification
pub(crate) fn get_leader_at(&self, date: BlockDate) -> BftLeaderId
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LeadershipData
impl Send for LeadershipData
impl Sync for LeadershipData
impl Unpin for LeadershipData
impl UnwindSafe for LeadershipData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more