Trait ibc_query::core::context::QueryContext
source · pub trait QueryContext: ProvableContext + ValidationContext {
// Required methods
fn client_states(
&self
) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, ContextError>;
fn consensus_states(
&self,
client_id: &ClientId
) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, ContextError>;
fn consensus_state_heights(
&self,
client_id: &ClientId
) -> Result<Vec<Height>, ContextError>;
fn connection_ends(
&self
) -> Result<Vec<IdentifiedConnectionEnd>, ContextError>;
fn client_connection_ends(
&self,
client_id: &ClientId
) -> Result<Vec<ConnectionId>, ContextError>;
fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, ContextError>;
fn packet_commitments(
&self,
channel_end_path: &ChannelEndPath
) -> Result<Vec<PacketState>, ContextError>;
fn packet_acknowledgements(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<PacketState>, ContextError>;
fn unreceived_packets(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<Sequence>, ContextError>;
fn unreceived_acks(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<Sequence>, ContextError>;
}
Expand description
Context to be implemented by the host that provides gRPC query services.
Required Methods§
sourcefn client_states(
&self
) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, ContextError>
fn client_states( &self ) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, ContextError>
Returns the list of all clients.
sourcefn consensus_states(
&self,
client_id: &ClientId
) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, ContextError>
fn consensus_states( &self, client_id: &ClientId ) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, ContextError>
Returns the list of all consensus states for the given client.
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 the list of all heights at which consensus states for the given client are.
sourcefn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, ContextError>
fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, ContextError>
Returns the list of all connection ends.
sourcefn client_connection_ends(
&self,
client_id: &ClientId
) -> Result<Vec<ConnectionId>, ContextError>
fn client_connection_ends( &self, client_id: &ClientId ) -> Result<Vec<ConnectionId>, ContextError>
Returns the list of all connection ids of the given client.
sourcefn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, ContextError>
fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, ContextError>
Returns the list of all channel ends.
sourcefn packet_commitments(
&self,
channel_end_path: &ChannelEndPath
) -> Result<Vec<PacketState>, ContextError>
fn packet_commitments( &self, channel_end_path: &ChannelEndPath ) -> Result<Vec<PacketState>, ContextError>
Returns the list of all packet commitments for the given channel end.
sourcefn packet_acknowledgements(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<PacketState>, ContextError>
fn packet_acknowledgements( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence> ) -> Result<Vec<PacketState>, ContextError>
Filters the list of packet sequences for the given channel end that are acknowledged.
Returns all the packet acknowledgements if sequences
is empty.
sourcefn unreceived_packets(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<Sequence>, ContextError>
fn unreceived_packets( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence> ) -> Result<Vec<Sequence>, ContextError>
Filters the packet sequences for the given channel end that are not received.
sourcefn unreceived_acks(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>
) -> Result<Vec<Sequence>, ContextError>
fn unreceived_acks( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence> ) -> Result<Vec<Sequence>, ContextError>
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.