Trait ibc_core_host::ExecutionContext
source · pub trait ExecutionContext: ValidationContext {
type E: ClientExecutionContext;
Show 17 methods
// Required methods
fn get_client_execution_context(&mut self) -> &mut Self::E;
fn increase_client_counter(&mut self) -> Result<(), ContextError>;
fn store_connection(
&mut self,
connection_path: &ConnectionPath,
connection_end: ConnectionEnd,
) -> Result<(), ContextError>;
fn store_connection_to_client(
&mut self,
client_connection_path: &ClientConnectionPath,
conn_id: ConnectionId,
) -> Result<(), ContextError>;
fn increase_connection_counter(&mut self) -> Result<(), ContextError>;
fn store_packet_commitment(
&mut self,
commitment_path: &CommitmentPath,
commitment: PacketCommitment,
) -> Result<(), ContextError>;
fn delete_packet_commitment(
&mut self,
commitment_path: &CommitmentPath,
) -> Result<(), ContextError>;
fn store_packet_receipt(
&mut self,
receipt_path: &ReceiptPath,
receipt: Receipt,
) -> Result<(), ContextError>;
fn store_packet_acknowledgement(
&mut self,
ack_path: &AckPath,
ack_commitment: AcknowledgementCommitment,
) -> Result<(), ContextError>;
fn delete_packet_acknowledgement(
&mut self,
ack_path: &AckPath,
) -> Result<(), ContextError>;
fn store_channel(
&mut self,
channel_end_path: &ChannelEndPath,
channel_end: ChannelEnd,
) -> Result<(), ContextError>;
fn store_next_sequence_send(
&mut self,
seq_send_path: &SeqSendPath,
seq: Sequence,
) -> Result<(), ContextError>;
fn store_next_sequence_recv(
&mut self,
seq_recv_path: &SeqRecvPath,
seq: Sequence,
) -> Result<(), ContextError>;
fn store_next_sequence_ack(
&mut self,
seq_ack_path: &SeqAckPath,
seq: Sequence,
) -> Result<(), ContextError>;
fn increase_channel_counter(&mut self) -> Result<(), ContextError>;
fn emit_ibc_event(&mut self, event: IbcEvent) -> Result<(), ContextError>;
fn log_message(&mut self, message: String) -> Result<(), ContextError>;
}
Expand description
Context to be implemented by the host that provides all “write-only” methods.
Trait used for the top-level execute
and dispatch
entrypoints in the ibc-core
crate.
Required Associated Types§
Required Methods§
sourcefn get_client_execution_context(&mut self) -> &mut Self::E
fn get_client_execution_context(&mut self) -> &mut Self::E
Retrieve the context that implements all clients’ ExecutionContext
.
sourcefn increase_client_counter(&mut self) -> Result<(), ContextError>
fn increase_client_counter(&mut self) -> Result<(), ContextError>
Called upon client creation. Increases the counter, that keeps track of how many clients have been created.
sourcefn store_connection(
&mut self,
connection_path: &ConnectionPath,
connection_end: ConnectionEnd,
) -> Result<(), ContextError>
fn store_connection( &mut self, connection_path: &ConnectionPath, connection_end: ConnectionEnd, ) -> Result<(), ContextError>
Stores the given connection_end at path
sourcefn store_connection_to_client(
&mut self,
client_connection_path: &ClientConnectionPath,
conn_id: ConnectionId,
) -> Result<(), ContextError>
fn store_connection_to_client( &mut self, client_connection_path: &ClientConnectionPath, conn_id: ConnectionId, ) -> Result<(), ContextError>
Stores the given connection_id at a path associated with the client_id.
sourcefn increase_connection_counter(&mut self) -> Result<(), ContextError>
fn increase_connection_counter(&mut self) -> Result<(), ContextError>
Called upon connection identifier creation (Init or Try process). Increases the counter which keeps track of how many connections have been created.
sourcefn store_packet_commitment(
&mut self,
commitment_path: &CommitmentPath,
commitment: PacketCommitment,
) -> Result<(), ContextError>
fn store_packet_commitment( &mut self, commitment_path: &CommitmentPath, commitment: PacketCommitment, ) -> Result<(), ContextError>
Stores the given packet commitment at the given store path
sourcefn delete_packet_commitment(
&mut self,
commitment_path: &CommitmentPath,
) -> Result<(), ContextError>
fn delete_packet_commitment( &mut self, commitment_path: &CommitmentPath, ) -> Result<(), ContextError>
Deletes the packet commitment at the given store path
sourcefn store_packet_receipt(
&mut self,
receipt_path: &ReceiptPath,
receipt: Receipt,
) -> Result<(), ContextError>
fn store_packet_receipt( &mut self, receipt_path: &ReceiptPath, receipt: Receipt, ) -> Result<(), ContextError>
Stores the given packet receipt at the given store path
sourcefn store_packet_acknowledgement(
&mut self,
ack_path: &AckPath,
ack_commitment: AcknowledgementCommitment,
) -> Result<(), ContextError>
fn store_packet_acknowledgement( &mut self, ack_path: &AckPath, ack_commitment: AcknowledgementCommitment, ) -> Result<(), ContextError>
Stores the given packet acknowledgement at the given store path
sourcefn delete_packet_acknowledgement(
&mut self,
ack_path: &AckPath,
) -> Result<(), ContextError>
fn delete_packet_acknowledgement( &mut self, ack_path: &AckPath, ) -> Result<(), ContextError>
Deletes the packet acknowledgement at the given store path
sourcefn store_channel(
&mut self,
channel_end_path: &ChannelEndPath,
channel_end: ChannelEnd,
) -> Result<(), ContextError>
fn store_channel( &mut self, channel_end_path: &ChannelEndPath, channel_end: ChannelEnd, ) -> Result<(), ContextError>
Stores the given channel_end at a path associated with the port_id and channel_id.
sourcefn store_next_sequence_send(
&mut self,
seq_send_path: &SeqSendPath,
seq: Sequence,
) -> Result<(), ContextError>
fn store_next_sequence_send( &mut self, seq_send_path: &SeqSendPath, seq: Sequence, ) -> Result<(), ContextError>
Stores the given nextSequenceSend
number at the given store path
sourcefn store_next_sequence_recv(
&mut self,
seq_recv_path: &SeqRecvPath,
seq: Sequence,
) -> Result<(), ContextError>
fn store_next_sequence_recv( &mut self, seq_recv_path: &SeqRecvPath, seq: Sequence, ) -> Result<(), ContextError>
Stores the given nextSequenceRecv
number at the given store path
sourcefn store_next_sequence_ack(
&mut self,
seq_ack_path: &SeqAckPath,
seq: Sequence,
) -> Result<(), ContextError>
fn store_next_sequence_ack( &mut self, seq_ack_path: &SeqAckPath, seq: Sequence, ) -> Result<(), ContextError>
Stores the given nextSequenceAck
number at the given store path
sourcefn increase_channel_counter(&mut self) -> Result<(), ContextError>
fn increase_channel_counter(&mut self) -> Result<(), ContextError>
Called upon channel identifier creation (Init or Try message processing). Increases the counter, that keeps track of how many channels have been created.
sourcefn emit_ibc_event(&mut self, event: IbcEvent) -> Result<(), ContextError>
fn emit_ibc_event(&mut self, event: IbcEvent) -> Result<(), ContextError>
Emit the given IBC event
sourcefn log_message(&mut self, message: String) -> Result<(), ContextError>
fn log_message(&mut self, message: String) -> Result<(), ContextError>
Log the given message.