Trait ibc::ics02_client::client_def::ClientDef[][src]

pub trait ClientDef: Clone {
    type Header: Header;
    type ClientState: ClientState;
    type ConsensusState: ConsensusState;
    fn check_header_and_update_state(
        &self,
        client_state: Self::ClientState,
        header: Self::Header
    ) -> Result<(Self::ClientState, Self::ConsensusState), Box<dyn Error>>;
fn verify_client_consensus_state(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        prefix: &CommitmentPrefix,
        proof: &CommitmentProofBytes,
        client_id: &ClientId,
        consensus_height: Height,
        expected_consensus_state: &AnyConsensusState
    ) -> Result<(), Box<dyn Error>>;
fn verify_connection_state(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        prefix: &CommitmentPrefix,
        proof: &CommitmentProofBytes,
        connection_id: Option<&ConnectionId>,
        expected_connection_end: &ConnectionEnd
    ) -> Result<(), Box<dyn Error>>;
fn verify_channel_state(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        prefix: &CommitmentPrefix,
        proof: &CommitmentProofBytes,
        port_id: &PortId,
        channel_id: &ChannelId,
        expected_channel_end: &ChannelEnd
    ) -> Result<(), Box<dyn Error>>;
fn verify_client_full_state(
        &self,
        _client_state: &Self::ClientState,
        height: Height,
        root: &CommitmentRoot,
        prefix: &CommitmentPrefix,
        client_id: &ClientId,
        proof: &CommitmentProofBytes,
        client_state: &AnyClientState
    ) -> Result<(), Box<dyn Error>>;
fn verify_packet_data(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        proof: &CommitmentProofBytes,
        port_id: &PortId,
        channel_id: &ChannelId,
        seq: &Sequence,
        commitment: String
    ) -> Result<(), Box<dyn Error>>;
fn verify_packet_acknowledgement(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        proof: &CommitmentProofBytes,
        port_id: &PortId,
        channel_id: &ChannelId,
        seq: &Sequence,
        ack: Vec<u8>
    ) -> Result<(), Box<dyn Error>>;
fn verify_next_sequence_recv(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        proof: &CommitmentProofBytes,
        port_id: &PortId,
        channel_id: &ChannelId,
        seq: &Sequence
    ) -> Result<(), Box<dyn Error>>;
fn verify_packet_receipt_absence(
        &self,
        client_state: &Self::ClientState,
        height: Height,
        proof: &CommitmentProofBytes,
        port_id: &PortId,
        channel_id: &ChannelId,
        seq: &Sequence
    ) -> Result<(), Box<dyn Error>>; }

Associated Types

Loading content...

Required methods

fn check_header_and_update_state(
    &self,
    client_state: Self::ClientState,
    header: Self::Header
) -> Result<(Self::ClientState, Self::ConsensusState), Box<dyn Error>>
[src]

TODO

fn verify_client_consensus_state(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    prefix: &CommitmentPrefix,
    proof: &CommitmentProofBytes,
    client_id: &ClientId,
    consensus_height: Height,
    expected_consensus_state: &AnyConsensusState
) -> Result<(), Box<dyn Error>>
[src]

Verification functions as specified in: https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics

Verify a proof that the consensus state of a given client (at height consensus_height) matches the input consensus_state. The parameter counterparty_height represent the height of the counterparty chain that this proof assumes (i.e., the height at which this proof was computed).

fn verify_connection_state(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    prefix: &CommitmentPrefix,
    proof: &CommitmentProofBytes,
    connection_id: Option<&ConnectionId>,
    expected_connection_end: &ConnectionEnd
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that a connection state matches that of the input connection_end.

fn verify_channel_state(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    prefix: &CommitmentPrefix,
    proof: &CommitmentProofBytes,
    port_id: &PortId,
    channel_id: &ChannelId,
    expected_channel_end: &ChannelEnd
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that a channel state matches that of the input channel_end.

fn verify_client_full_state(
    &self,
    _client_state: &Self::ClientState,
    height: Height,
    root: &CommitmentRoot,
    prefix: &CommitmentPrefix,
    client_id: &ClientId,
    proof: &CommitmentProofBytes,
    client_state: &AnyClientState
) -> Result<(), Box<dyn Error>>
[src]

Verify the client state for this chain that it is stored on the counterparty chain.

fn verify_packet_data(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    proof: &CommitmentProofBytes,
    port_id: &PortId,
    channel_id: &ChannelId,
    seq: &Sequence,
    commitment: String
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that a packet has been commited.

fn verify_packet_acknowledgement(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    proof: &CommitmentProofBytes,
    port_id: &PortId,
    channel_id: &ChannelId,
    seq: &Sequence,
    ack: Vec<u8>
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that a packet has been commited.

fn verify_next_sequence_recv(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    proof: &CommitmentProofBytes,
    port_id: &PortId,
    channel_id: &ChannelId,
    seq: &Sequence
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that of the next_seq_received.

fn verify_packet_receipt_absence(
    &self,
    client_state: &Self::ClientState,
    height: Height,
    proof: &CommitmentProofBytes,
    port_id: &PortId,
    channel_id: &ChannelId,
    seq: &Sequence
) -> Result<(), Box<dyn Error>>
[src]

Verify a proof that a packet has not been received.

Loading content...

Implementors

impl ClientDef for AnyClient[src]

type Header = AnyHeader

type ClientState = AnyClientState

type ConsensusState = AnyConsensusState

fn check_header_and_update_state(
    &self,
    client_state: AnyClientState,
    header: AnyHeader
) -> Result<(AnyClientState, AnyConsensusState), Box<dyn Error>>
[src]

Validates an incoming header against the latest consensus state of this client.

impl ClientDef for TendermintClient[src]

type Header = Header

type ClientState = ClientState

type ConsensusState = ConsensusState

Loading content...