1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use ;
pub use crateCallback;
/// wasmd 0.32+ will not return a hardcoded ICS-20 ACK if
/// ibc_packet_receive errors [1] so we can safely use an ACK format
/// that is not ICS-20 error-variant compatible.
///
/// [1]: https://github.com/CosmWasm/wasmd/issues/1305#issuecomment-1489871618
pub type Ack = Callback;
/// Serializes an ACK-SUCCESS containing the provided data.
///
// pub fn ack_query_success(result: Vec<Binary>) -> Binary {
// to_json_binary(&Callback::Query(Ok(result))).unwrap()
// }
/// Serializes an ACK-SUCCESS for a query that failed.
// pub fn ack_query_fail(message_index: Uint64, error: String) -> Binary {
// to_json_binary(&Callback::Query(Err(ErrorResponse {
// message_index,
// error,
// })))
// .unwrap()
// }
/// Serializes an ACK-SUCCESS for execution that succeeded.
// pub fn ack_execute_success(result: Vec<HexBinary>, executed_by: String) -> Binary {
// to_json_binary(&Callback::Execute(Ok(ExecutionResponse {
// result: result.into_iter().map(|data| ExecuteResult{ success: true, data }).collect(),
// executed_by,
// })))
// .unwrap()
// }
/// Serializes an ACK-SUCCESS for execution that failed.
/// Serializes an ACK-FAIL containing the provided error.
/// Unmarshals an ACK from an acknowledgement returned by the SDK. If
/// the returned acknowledgement can not be parsed into an ACK,
/// err(base64(ack)) is returned.