@@ -32,15 +32,26 @@ pub enum IbcMsg {
32
32
/// packet data only supports one coin
33
33
/// https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20
34
34
amount : Coin ,
35
- /// block after which the packet times out.
36
- /// at least one of timeout_block, timeout_timestamp is required
37
- timeout_block : Option <IbcTimeoutBlock >,
38
- /// block timestamp (nanoseconds since UNIX epoch) after which the packet times out.
39
- /// See https://golang.org/pkg/time/#Time.UnixNano
40
- /// at least one of timeout_block, timeout_timestamp is required
41
- timeout_timestamp : Option <u64 >,
35
+ /// when packet times out, measured on remote chain
36
+ timeout : IbcTimeout ,
42
37
}
43
38
}
39
+
40
+ #[derive(Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
41
+ #[serde(rename_all = " snake_case" )]
42
+ pub enum IbcTimeout {
43
+ /// block timestamp (nanoseconds since UNIX epoch) after which the packet times out
44
+ /// (measured on the remote chain)
45
+ /// See https://golang.org/pkg/time/#Time.UnixNano
46
+ TimestampNanos (u64 ),
47
+ /// block after which the packet times out (measured on remote chain)
48
+ Block (IbcTimeoutBlock ),
49
+ Both {
50
+ timestamp_nanos : u64 ,
51
+ block : IbcTimeoutBlock ,
52
+ },
53
+ }
54
+
44
55
```
45
56
46
57
Note the ` to_address ` is likely not a valid ` Addr ` , as it uses the bech32 prefix
@@ -226,13 +237,8 @@ pub enum IbcMsg {
226
237
SendPacket {
227
238
channel_id : String ,
228
239
data : Binary ,
229
- /// block height after which the packet times out.
230
- /// at least one of timeout_block, timeout_timestamp is required
231
- timeout_block : Option <IbcTimeoutBlock >,
232
- /// block timestamp (nanoseconds since UNIX epoch) after which the packet times out.
233
- /// See https://golang.org/pkg/time/#Time.UnixNano
234
- /// at least one of timeout_block, timeout_timestamp is required
235
- timeout_timestamp : Option <u64 >,
240
+ /// when packet times out, measured on remote chain
241
+ timeout : IbcTimeout ,
236
242
},
237
243
}
238
244
```
0 commit comments