type IBCApp
interface 1type IBCApp interface {
2 // OnSendPacket is executed when a packet is being sent from sending chain.
3 // This callback is provided with the source and destination IDs, the signer,
4 // the packet sequence and the packet data for this specific application.
5 OnSendPacket(
6 cur realm,
7 sourceClient string,
8 destinationClient string,
9 sequence uint64,
10 payload types.Payload,
11 ) error
12
13 // OnRecvPacket is executed when a packet is received from receiving chain.
14 //
15 // CONTRACT: unlike other functions of this interface, OnRecvPacket does not
16 // return an error, this is because in case of error (i.e. when
17 // RecvPacketResult.Status == Failure), the underlying transaction is not
18 // aborted. So implementer of this interface must keep in mind that any
19 // writes to the store and all emitted events in this function aren't not
20 // canceled if it returns RecvPacketResult.Status == Failure.
21 OnRecvPacket(
22 cur realm,
23 sourceClient string,
24 destinationClient string,
25 sequence uint64,
26 payload types.Payload,
27 ) types.RecvPacketResult
28
29 // OnTimeoutPacket is executed when a packet has timed out on the receiving
30 // chain.
31 OnTimeoutPacket(
32 cur realm,
33 sourceClient string,
34 destinationClient string,
35 sequence uint64,
36 payload types.Payload,
37 ) error
38
39 // OnAcknowledgementPacket is executed when a packet gets acknowledged.
40 OnAcknowledgementPacket(
41 cur realm,
42 sourceClient string,
43 destinationClient string,
44 sequence uint64,
45 acknowledgement []byte,
46 payload types.Payload,
47 ) error
48}IBCApp defines an interface that implements all the callbacks that apps must define as specified in IBC Protocol V2.