Trait tendermint_machine::ext::Weights
source · pub trait Weights: Send + Sync {
type ValidatorId: ValidatorId;
// Required methods
fn total_weight(&self) -> u64;
fn weight(&self, validator: Self::ValidatorId) -> u64;
fn proposer(
&self,
block: BlockNumber,
round: RoundNumber,
) -> Self::ValidatorId;
// Provided methods
fn threshold(&self) -> u64 { ... }
fn fault_threshold(&self) -> u64 { ... }
}
Expand description
Weights for the validators present.
Required Associated Types§
type ValidatorId: ValidatorId
Required Methods§
sourcefn total_weight(&self) -> u64
fn total_weight(&self) -> u64
Total weight of all validators.
sourcefn weight(&self, validator: Self::ValidatorId) -> u64
fn weight(&self, validator: Self::ValidatorId) -> u64
Weight for a specific validator.
sourcefn proposer(&self, block: BlockNumber, round: RoundNumber) -> Self::ValidatorId
fn proposer(&self, block: BlockNumber, round: RoundNumber) -> Self::ValidatorId
Weighted round robin function.
Provided Methods§
sourcefn fault_threshold(&self) -> u64
fn fault_threshold(&self) -> u64
Threshold preventing BFT consensus.