ibc-core-client-context 0.57.0

Maintaind by `ibc-rs`, contains essential APIs to interface with the host chain's store, enabling smooth client state transitions. Additionally, provides necessary traits for implementing custom IBC light clients.
Documentation
//! Defines the trait to be implemented by all concrete consensus state types

use ibc_core_client_types::error::ClientError;
use ibc_core_commitment_types::commitment::CommitmentRoot;
use ibc_primitives::prelude::*;
use ibc_primitives::proto::Any;
use ibc_primitives::Timestamp;

use crate::Convertible;

/// Defines methods that all `ConsensusState`s should provide.
///
/// One can think of a "consensus state" as a pruned header, to be stored on chain. In other words,
/// a consensus state only contains the header's information needed by IBC message handlers.
pub trait ConsensusState: Send + Sync + Convertible<Any> {
    /// Commitment root of the consensus state, which is used for key-value pair verification.
    fn root(&self) -> &CommitmentRoot;

    /// The timestamp of the consensus state
    fn timestamp(&self) -> Result<Timestamp, ClientError>;
}