Skip to content

Commit 31d8cf3

Browse files
committed
Improve docs
1 parent abf5c76 commit 31d8cf3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/std/src/ibc/callbacks.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,16 @@ impl IbcTimeoutCallbackMsg {
154154
/// A prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know
155155
/// that someone sent you IBC coins.
156156
///
157+
/// It is important to validate that the packet and acknowledgement are what you expect them to be.
158+
/// For example for a transfer message, the receiver is not necessarily the contract itself.
159+
///
157160
/// The callback is called after the packet was acknowledged on the destination chain, as follows:
158161
/// - If the acknowledgement is synchronous (i.e. returned immediately when the packet is received),
159162
/// the callback is called only if the acknowledgement was successful.
160163
/// - If the acknowledgement is asynchronous (i.e. written later using `WriteAcknowledgement`),
161164
/// the callback is called regardless of the success of the acknowledgement.
162165
///
163-
/// Note that there are some prerequisites that need to be fulfilled to receive source callbacks:
166+
/// Note that there are some prerequisites that need to be fulfilled to receive destination callbacks:
164167
/// - The contract must implement the `ibc_destination_callback` entrypoint.
165168
/// - The IBC application in the destination chain must have support for the callbacks middleware.
166169
/// - You have to add serialized [`IbcCallbackRequest`] to a specific field of the message.

0 commit comments

Comments
 (0)