Skip to content

Commit 1c36c59

Browse files
committed
Update IbcTimeout docs
1 parent 021b045 commit 1c36c59

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

IBC.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,24 @@ pub enum IbcMsg {
3737
}
3838
}
3939

40+
/// In IBC each package must set at least one type of timeout:
41+
/// the timestamp or the block height. Using this rather complex enum instead of
42+
/// two timeout fields we ensure that at least one timeout is set.
4043
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
4144
#[serde(rename_all = "snake_case")]
4245
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)
46+
/// Block timestamp (nanoseconds since UNIX epoch) after which the packet times out
47+
/// (measured on the remote chain).
48+
Timestamp(Timestamp),
49+
/// Block after which the packet times out (measured on remote chain).
4850
Block(IbcTimeoutBlock),
51+
/// Use this to set both timestamp and block timeout. The package then times out once
52+
/// the first of both timeouts is hit.
4953
Both {
50-
timestamp_nanos: u64,
54+
timestamp: Timestamp,
5155
block: IbcTimeoutBlock,
5256
},
5357
}
54-
5558
```
5659

5760
Note the `to_address` is likely not a valid `Addr`, as it uses the bech32 prefix

0 commit comments

Comments
 (0)