pub trait LeaderSelection {
type Block: Block;
type Error: Error;
type LeaderId: LeaderId;
type State: State;
fn retrieve(state: &Self::State) -> Self;
fn get_leader_at(
&self,
date: <Self::Block as Block>::Date
) -> Result<Self::LeaderId, Self::Error>;
}Expand description
interface for the leader selection algorithm
this is the interface that is responsible to verify the Block are created by the right Leaders (i.e. that everyone follows the consensus algorithm).
This is also the same interface that is used to detect if we are the leader for the block at the given date.