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

    // Required methods
    fn client_state(
        &self,
        client_id: &ClientId
    ) -> Result<Self::ClientStateRef, ContextError>;
    fn consensus_state(
        &self,
        client_cons_state_path: &ClientConsensusStatePath
    ) -> Result<Self::ConsensusStateRef, ContextError>;
    fn client_update_meta(
        &self,
        client_id: &ClientId,
        height: &Height
    ) -> Result<(Timestamp, Height), ContextError>;
}
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, ContextError>

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, ContextError>

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), ContextError>

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

Object Safety§

This trait is not object safe.

Implementors§