[][src]Trait tendermint_light_client::predicates::VerificationPredicates

pub trait VerificationPredicates: Send + Sync {
    pub fn validator_sets_match(
        &self,
        light_block: &LightBlock,
        hasher: &dyn Hasher
    ) -> Result<(), VerificationError> { ... }
pub fn next_validators_match(
        &self,
        light_block: &LightBlock,
        hasher: &dyn Hasher
    ) -> Result<(), VerificationError> { ... }
pub fn header_matches_commit(
        &self,
        signed_header: &SignedHeader,
        hasher: &dyn Hasher
    ) -> Result<(), VerificationError> { ... }
pub fn valid_commit(
        &self,
        signed_header: &SignedHeader,
        validators: &ValidatorSet,
        commit_validator: &dyn CommitValidator
    ) -> Result<(), VerificationError> { ... }
pub fn is_within_trust_period(
        &self,
        trusted_header: &Header,
        trusting_period: Duration,
        now: Time
    ) -> Result<(), VerificationError> { ... }
pub fn is_header_from_past(
        &self,
        untrusted_header: &Header,
        clock_drift: Duration,
        now: Time
    ) -> Result<(), VerificationError> { ... }
pub fn is_monotonic_bft_time(
        &self,
        untrusted_header: &Header,
        trusted_header: &Header
    ) -> Result<(), VerificationError> { ... }
pub fn is_monotonic_height(
        &self,
        untrusted_header: &Header,
        trusted_header: &Header
    ) -> Result<(), VerificationError> { ... }
pub fn has_sufficient_validators_overlap(
        &self,
        untrusted_sh: &SignedHeader,
        trusted_validators: &ValidatorSet,
        trust_threshold: &TrustThreshold,
        calculator: &dyn VotingPowerCalculator
    ) -> Result<(), VerificationError> { ... }
pub fn has_sufficient_signers_overlap(
        &self,
        untrusted_sh: &SignedHeader,
        untrusted_validators: &ValidatorSet,
        calculator: &dyn VotingPowerCalculator
    ) -> Result<(), VerificationError> { ... }
pub fn valid_next_validator_set(
        &self,
        light_block: &LightBlock,
        trusted_state: &LightBlock
    ) -> Result<(), VerificationError> { ... } }

Defines the various predicates used to validate and verify light blocks.

A default, spec abiding implementation is provided for each method.

This enables test implementations to only override a single method rather than have to re-define every predicate.

Provided methods

pub fn validator_sets_match(
    &self,
    light_block: &LightBlock,
    hasher: &dyn Hasher
) -> Result<(), VerificationError>
[src]

Compare the provided validator_set_hash against the hash produced from hashing the validator set.

pub fn next_validators_match(
    &self,
    light_block: &LightBlock,
    hasher: &dyn Hasher
) -> Result<(), VerificationError>
[src]

Check that the hash of the next validator set in the header match the actual one.

pub fn header_matches_commit(
    &self,
    signed_header: &SignedHeader,
    hasher: &dyn Hasher
) -> Result<(), VerificationError>
[src]

Check that the hash of the header in the commit matches the actual one.

pub fn valid_commit(
    &self,
    signed_header: &SignedHeader,
    validators: &ValidatorSet,
    commit_validator: &dyn CommitValidator
) -> Result<(), VerificationError>
[src]

Validate the commit using the given commit validator.

pub fn is_within_trust_period(
    &self,
    trusted_header: &Header,
    trusting_period: Duration,
    now: Time
) -> Result<(), VerificationError>
[src]

Check that the trusted header is within the trusting period, adjusting for clock drift.

pub fn is_header_from_past(
    &self,
    untrusted_header: &Header,
    clock_drift: Duration,
    now: Time
) -> Result<(), VerificationError>
[src]

Check that the untrusted header is from past.

pub fn is_monotonic_bft_time(
    &self,
    untrusted_header: &Header,
    trusted_header: &Header
) -> Result<(), VerificationError>
[src]

Check that time passed monotonically between the trusted header and the untrusted one.

pub fn is_monotonic_height(
    &self,
    untrusted_header: &Header,
    trusted_header: &Header
) -> Result<(), VerificationError>
[src]

Check that the height increased between the trusted header and the untrusted one.

pub fn has_sufficient_validators_overlap(
    &self,
    untrusted_sh: &SignedHeader,
    trusted_validators: &ValidatorSet,
    trust_threshold: &TrustThreshold,
    calculator: &dyn VotingPowerCalculator
) -> Result<(), VerificationError>
[src]

Check that there is enough validators overlap between the trusted validator set and the untrusted signed header.

pub fn has_sufficient_signers_overlap(
    &self,
    untrusted_sh: &SignedHeader,
    untrusted_validators: &ValidatorSet,
    calculator: &dyn VotingPowerCalculator
) -> Result<(), VerificationError>
[src]

Check that there is enough signers overlap between the given, untrusted validator set and the untrusted signed header.

pub fn valid_next_validator_set(
    &self,
    light_block: &LightBlock,
    trusted_state: &LightBlock
) -> Result<(), VerificationError>
[src]

Check that the hash of the next validator set in the trusted block matches the hash of the validator set in the untrusted one.

Loading content...

Implementors

impl VerificationPredicates for ProdPredicates[src]

Loading content...