[−][src]Trait tendermint_light_client::operations::voting_power::VotingPowerCalculator
Computes the voting power in a commit against a validator set.
This trait provides default implementation of some helper functions.
Required methods
fn voting_power_in(
&self,
signed_header: &SignedHeader,
validator_set: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<VotingPowerTally, VerificationError>
&self,
signed_header: &SignedHeader,
validator_set: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<VotingPowerTally, VerificationError>
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.
Provided methods
fn total_power_of(&self, validator_set: &ValidatorSet) -> u64
Compute the total voting power in a validator set
fn check_enough_trust(
&self,
untrusted_header: &SignedHeader,
trusted_validators: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<(), VerificationError>
&self,
untrusted_header: &SignedHeader,
trusted_validators: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<(), VerificationError>
Check against the given threshold that there is enough trust between an untrusted header and a trusted validator set
fn check_signers_overlap(
&self,
untrusted_header: &SignedHeader,
untrusted_validators: &ValidatorSet
) -> Result<(), VerificationError>
&self,
untrusted_header: &SignedHeader,
untrusted_validators: &ValidatorSet
) -> Result<(), VerificationError>
Check against the given threshold that there is enough signers overlap between an untrusted header and untrusted validator set
Implementors
impl VotingPowerCalculator for ProdVotingPowerCalculator
[src]
fn voting_power_in(
&self,
signed_header: &SignedHeader,
validator_set: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<VotingPowerTally, VerificationError>
[src]
&self,
signed_header: &SignedHeader,
validator_set: &ValidatorSet,
trust_threshold: TrustThreshold
) -> Result<VotingPowerTally, VerificationError>