Skip to content

Commit c6a435e

Browse files
committed
Update destination chain callback type
1 parent 32a1401 commit c6a435e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

types/ibc.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ type IBCSourceChainCallbackMsg struct {
169169
}
170170

171171
// The message type of the IBC destination chain callback.
172-
// This is just an alias for [`IbcPacketReceiveMsg`] to add some documentation.
173172
//
174173
// The IBC destination chain callback is needed for cases where someone triggers the sending of an
175174
// IBC packet through some other message (i.e. not through [`IbcMsg::SendPacket`]) and
176175
// your contract needs to know that it received this.
176+
// The callback is called after the packet was successfully acknowledged on the destination chain.
177177
// A prominent example is the [`IbcMsg::Transfer`] message. Without callbacks, you cannot know
178178
// that someone sent you IBC coins.
179179
//
@@ -183,7 +183,10 @@ type IBCSourceChainCallbackMsg struct {
183183
// (i.e. the destination chain needs to support callbacks for the message you are being sent).
184184
// - You have to add json-encoded [`IbcCallbackData`] to a specific field of the message.
185185
// For `IbcMsg::Transfer`, this is the `memo` field.
186-
type IBCDestinationChainCallbackMsg = IBCPacketReceiveMsg
186+
type IBCDestinationChainCallbackMsg struct {
187+
Ack IBCAcknowledgement `json:"ack"`
188+
Packet IBCPacket `json:"packet"`
189+
}
187190

188191
// TODO: test what the sdk Order.String() represents and how to parse back
189192
// Proto files: https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80

0 commit comments

Comments
 (0)