[][src]Trait tendermint_light_client::operations::voting_power::VotingPowerCalculator

pub trait VotingPowerCalculator: Send + Sync {
    pub fn voting_power_in(
        &self,
        signed_header: &SignedHeader,
        validator_set: &ValidatorSet,
        trust_threshold: TrustThreshold
    ) -> Result<VotingPowerTally, VerificationError>; pub fn total_power_of(&self, validator_set: &ValidatorSet) -> u64 { ... }
pub fn check_enough_trust(
        &self,
        untrusted_header: &SignedHeader,
        trusted_validators: &ValidatorSet,
        trust_threshold: TrustThreshold
    ) -> Result<(), VerificationError> { ... }
pub fn check_signers_overlap(
        &self,
        untrusted_header: &SignedHeader,
        untrusted_validators: &ValidatorSet
    ) -> Result<(), VerificationError> { ... } }

Computes the voting power in a commit against a validator set.

This trait provides default implementation of some helper functions.

Required methods

pub fn voting_power_in(
    &self,
    signed_header: &SignedHeader,
    validator_set: &ValidatorSet,
    trust_threshold: TrustThreshold
) -> Result<VotingPowerTally, VerificationError>
[src]

Compute the voting power in a header and its commit against a validator set.

The trust_threshold is currently not used, but might be in the future for optimization purposes.

Loading content...

Provided methods

pub fn total_power_of(&self, validator_set: &ValidatorSet) -> u64[src]

Compute the total voting power in a validator set

pub fn check_enough_trust(
    &self,
    untrusted_header: &SignedHeader,
    trusted_validators: &ValidatorSet,
    trust_threshold: TrustThreshold
) -> Result<(), VerificationError>
[src]

Check against the given threshold that there is enough trust between an untrusted header and a trusted validator set

pub fn check_signers_overlap(
    &self,
    untrusted_header: &SignedHeader,
    untrusted_validators: &ValidatorSet
) -> Result<(), VerificationError>
[src]

Check against the given threshold that there is enough signers overlap between an untrusted header and untrusted validator set

Loading content...

Implementors

impl VotingPowerCalculator for ProdVotingPowerCalculator[src]

Loading content...