Trait ClientValidationContext

Source
pub trait ClientValidationContext: Sized {
    type ClientStateRef: ClientStateValidation<Self>;
    type ConsensusStateRef: ConsensusState;

    // Required methods
    fn client_state(
        &self,
        client_id: &ClientId,
    ) -> Result<Self::ClientStateRef, HostError>;
    fn consensus_state(
        &self,
        client_cons_state_path: &ClientConsensusStatePath,
    ) -> Result<Self::ConsensusStateRef, HostError>;
    fn client_update_meta(
        &self,
        client_id: &ClientId,
        height: &Height,
    ) -> Result<(Timestamp, Height), HostError>;
}
Expand description

Defines the methods available to clients for validating client state transitions. The generic V parameter in crate::client_state::ClientStateValidation must inherit from this trait.

Required Associated Types§

Required Methods§

Source

fn client_state( &self, client_id: &ClientId, ) -> Result<Self::ClientStateRef, HostError>

Returns the ClientState for the given identifier client_id.

Note: Clients have the responsibility to store client states on client creation and update.

Source

fn consensus_state( &self, client_cons_state_path: &ClientConsensusStatePath, ) -> Result<Self::ConsensusStateRef, HostError>

Retrieve the consensus state for the given client ID at the specified height.

Returns an error if no such state exists.

Note: Clients have the responsibility to store consensus states on client creation and update.

Source

fn client_update_meta( &self, client_id: &ClientId, height: &Height, ) -> Result<(Timestamp, Height), HostError>

Returns the timestamp and height of the host when it processed a client update request at the specified height.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§