From 87ee3c7fe971ef8c7e9b1575d4aced3bd80e597f Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Wed, 8 Nov 2023 13:10:13 +0100 Subject: [PATCH] Add example to constructor --- packages/std/src/ibc.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index a6f53b56cc..44032ce707 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -637,6 +637,16 @@ impl Default for IbcReceiveResponse { impl IbcReceiveResponse { /// Create a new response with the given acknowledgement. + /// + /// ## Examples + /// + /// ``` + /// use cosmwasm_std::{StdAck, IbcReceiveResponse}; + /// + /// // 0x01 is a FungibleTokenPacketSuccess from ICS-20. + /// let resp: IbcReceiveResponse = IbcReceiveResponse::new(StdAck::success(b"\x01")); + /// assert_eq!(resp.acknowledgement, b"{\"result\":\"AQ==\"}"); + /// ``` pub fn new(ack: impl Into) -> Self { Self { acknowledgement: ack.into(),