Trait ExtClientValidationContext

Source
pub trait ExtClientValidationContext: ClientValidationContext {
    // Required methods
    fn host_timestamp(&self) -> Result<Timestamp, HostError>;
    fn host_height(&self) -> Result<Height, HostError>;
    fn consensus_state_heights(
        &self,
        client_id: &ClientId,
    ) -> Result<Vec<Height>, HostError>;
    fn next_consensus_state(
        &self,
        client_id: &ClientId,
        height: &Height,
    ) -> Result<Option<Self::ConsensusStateRef>, HostError>;
    fn prev_consensus_state(
        &self,
        client_id: &ClientId,
        height: &Height,
    ) -> Result<Option<Self::ConsensusStateRef>, HostError>;
}
Expand description

An optional trait that extends the client validation context capabilities by providing additional methods for validating a client state. Mainly benefiting ICS-07 Tendermint clients by granting access to essential information from hosts.

Categorized under ICS-02, as it may also be utilized by other types of light clients. Developers may view this trait as an example of a custom context definition that expands client validation capabilities, according to their specific light client requirements.

Required Methods§

Source

fn host_timestamp(&self) -> Result<Timestamp, HostError>

Returns the current timestamp of the local chain.

Source

fn host_height(&self) -> Result<Height, HostError>

Returns the current height of the local chain.

Source

fn consensus_state_heights( &self, client_id: &ClientId, ) -> Result<Vec<Height>, HostError>

Returns all the heights at which a consensus state is stored.

Source

fn next_consensus_state( &self, client_id: &ClientId, height: &Height, ) -> Result<Option<Self::ConsensusStateRef>, HostError>

Search for the lowest consensus state higher than height.

Source

fn prev_consensus_state( &self, client_id: &ClientId, height: &Height, ) -> Result<Option<Self::ConsensusStateRef>, HostError>

Search for the highest consensus state lower than 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§