Trait QueryContext

Source
pub trait QueryContext: ProvableContext + ValidationContext {
    // Required methods
    fn client_states(
        &self,
    ) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>;
    fn consensus_states(
        &self,
        client_id: &ClientId,
    ) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>;
    fn consensus_state_heights(
        &self,
        client_id: &ClientId,
    ) -> Result<Vec<Height>, HostError>;
    fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>;
    fn client_connection_ends(
        &self,
        client_id: &ClientId,
    ) -> Result<Vec<ConnectionId>, HostError>;
    fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>;
    fn packet_commitments(
        &self,
        channel_end_path: &ChannelEndPath,
    ) -> Result<Vec<PacketState>, HostError>;
    fn packet_acknowledgements(
        &self,
        channel_end_path: &ChannelEndPath,
        sequences: impl ExactSizeIterator<Item = Sequence>,
    ) -> Result<Vec<PacketState>, HostError>;
    fn unreceived_packets(
        &self,
        channel_end_path: &ChannelEndPath,
        sequences: impl ExactSizeIterator<Item = Sequence>,
    ) -> Result<Vec<Sequence>, HostError>;
    fn unreceived_acks(
        &self,
        channel_end_path: &ChannelEndPath,
        sequences: impl ExactSizeIterator<Item = Sequence>,
    ) -> Result<Vec<Sequence>, HostError>;
}
Expand description

Context to be implemented by the host that provides gRPC query services.

Required Methods§

Source

fn client_states( &self, ) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>

Returns the list of all clients.

Source

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

Returns the list of all consensus states for the given client.

Source

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

Returns the list of all heights at which consensus states for the given client are.

Source

fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>

Returns the list of all connection ends.

Source

fn client_connection_ends( &self, client_id: &ClientId, ) -> Result<Vec<ConnectionId>, HostError>

Returns the list of all connection ids of the given client.

Source

fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>

Returns the list of all channel ends.

Source

fn packet_commitments( &self, channel_end_path: &ChannelEndPath, ) -> Result<Vec<PacketState>, HostError>

Returns the list of all packet commitments for the given channel end.

Source

fn packet_acknowledgements( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<PacketState>, HostError>

Filters the list of packet sequences for the given channel end that are acknowledged. Returns all the packet acknowledgements if sequences is empty.

Source

fn unreceived_packets( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<Sequence>, HostError>

Filters the packet sequences for the given channel end that are not received.

Source

fn unreceived_acks( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<Sequence>, HostError>

Filters the list of packet sequences for the given channel end whose acknowledgement is not received. Returns all the unreceived acknowledgements if sequences is empty.

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§