pub trait ExtClientValidationContext: ClientValidationContext {
// Required methods
fn host_timestamp(&self) -> Result<Timestamp, ContextError>;
fn host_height(&self) -> Result<Height, ContextError>;
fn consensus_state_heights(
&self,
client_id: &ClientId
) -> Result<Vec<Height>, ContextError>;
fn next_consensus_state(
&self,
client_id: &ClientId,
height: &Height
) -> Result<Option<Self::ConsensusStateRef>, ContextError>;
fn prev_consensus_state(
&self,
client_id: &ClientId,
height: &Height
) -> Result<Option<Self::ConsensusStateRef>, ContextError>;
}
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§
sourcefn host_timestamp(&self) -> Result<Timestamp, ContextError>
fn host_timestamp(&self) -> Result<Timestamp, ContextError>
Returns the current timestamp of the local chain.
sourcefn host_height(&self) -> Result<Height, ContextError>
fn host_height(&self) -> Result<Height, ContextError>
Returns the current height of the local chain.
sourcefn consensus_state_heights(
&self,
client_id: &ClientId
) -> Result<Vec<Height>, ContextError>
fn consensus_state_heights( &self, client_id: &ClientId ) -> Result<Vec<Height>, ContextError>
Returns all the heights at which a consensus state is stored.
sourcefn next_consensus_state(
&self,
client_id: &ClientId,
height: &Height
) -> Result<Option<Self::ConsensusStateRef>, ContextError>
fn next_consensus_state( &self, client_id: &ClientId, height: &Height ) -> Result<Option<Self::ConsensusStateRef>, ContextError>
Search for the lowest consensus state higher than height
.
sourcefn prev_consensus_state(
&self,
client_id: &ClientId,
height: &Height
) -> Result<Option<Self::ConsensusStateRef>, ContextError>
fn prev_consensus_state( &self, client_id: &ClientId, height: &Height ) -> Result<Option<Self::ConsensusStateRef>, ContextError>
Search for the highest consensus state lower than height
.