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§
type ClientStateRef: ClientStateValidation<Self>
type ConsensusStateRef: ConsensusState
Required Methods§
sourcefn client_state(
&self,
client_id: &ClientId,
) -> Result<Self::ClientStateRef, HostError>
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.
sourcefn consensus_state(
&self,
client_cons_state_path: &ClientConsensusStatePath,
) -> Result<Self::ConsensusStateRef, HostError>
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.
Object Safety§
This trait is not object safe.