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§
sourcefn client_states(
&self,
) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>
fn client_states( &self, ) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>
Returns the list of all clients.
sourcefn consensus_states(
&self,
client_id: &ClientId,
) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>
fn consensus_states( &self, client_id: &ClientId, ) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>
Returns the list of all consensus states for the given client.
sourcefn consensus_state_heights(
&self,
client_id: &ClientId,
) -> Result<Vec<Height>, HostError>
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.
sourcefn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>
fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>
Returns the list of all connection ends.
sourcefn client_connection_ends(
&self,
client_id: &ClientId,
) -> Result<Vec<ConnectionId>, HostError>
fn client_connection_ends( &self, client_id: &ClientId, ) -> Result<Vec<ConnectionId>, HostError>
Returns the list of all connection ids of the given client.
sourcefn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>
fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>
Returns the list of all channel ends.
sourcefn packet_commitments(
&self,
channel_end_path: &ChannelEndPath,
) -> Result<Vec<PacketState>, HostError>
fn packet_commitments( &self, channel_end_path: &ChannelEndPath, ) -> Result<Vec<PacketState>, HostError>
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>, HostError>
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.
sourcefn unreceived_packets(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<Sequence>, HostError>
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.
sourcefn unreceived_acks(
&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>
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.