pub trait ConsensusState: Send + Sync {
    // Required methods
    fn root(&self) -> &CommitmentRoot;
    fn timestamp(&self) -> Timestamp;
    fn encode_vec(self) -> Vec<u8> ;
}
Expand description

Defines methods that all ConsensusStates 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.

Required Methods§

source

fn root(&self) -> &CommitmentRoot

Commitment root of the consensus state, which is used for key-value pair verification.

source

fn timestamp(&self) -> Timestamp

The timestamp of the consensus state

source

fn encode_vec(self) -> Vec<u8>

Serializes the ConsensusState. This is expected to be implemented as first converting to the raw type (i.e. the protobuf definition), and then serializing that.

Implementors§