Skip to content

Commit 021b045

Browse files
committed
Add IbcTimeout docs
1 parent da57a5f commit 021b045

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

contracts/ibc-reflect-send/schema/execute_msg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,10 @@
435435
]
436436
},
437437
"IbcTimeout": {
438+
"description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.",
438439
"anyOf": [
439440
{
440-
"description": "block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain) See https://golang.org/pkg/time/#Time.UnixNano",
441+
"description": "Block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain).",
441442
"type": "object",
442443
"required": [
443444
"timestamp"
@@ -450,7 +451,7 @@
450451
"additionalProperties": false
451452
},
452453
{
453-
"description": "block after which the packet times out (measured on remote chain)",
454+
"description": "Block after which the packet times out (measured on remote chain).",
454455
"type": "object",
455456
"required": [
456457
"block"
@@ -463,6 +464,7 @@
463464
"additionalProperties": false
464465
},
465466
{
467+
"description": "Use this to set both timestamp and block timeout. The package then times out once the first of both timeouts is hit.",
466468
"type": "object",
467469
"required": [
468470
"both"

contracts/ibc-reflect-send/schema/packet_msg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,10 @@
388388
]
389389
},
390390
"IbcTimeout": {
391+
"description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.",
391392
"anyOf": [
392393
{
393-
"description": "block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain) See https://golang.org/pkg/time/#Time.UnixNano",
394+
"description": "Block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain).",
394395
"type": "object",
395396
"required": [
396397
"timestamp"
@@ -403,7 +404,7 @@
403404
"additionalProperties": false
404405
},
405406
{
406-
"description": "block after which the packet times out (measured on remote chain)",
407+
"description": "Block after which the packet times out (measured on remote chain).",
407408
"type": "object",
408409
"required": [
409410
"block"
@@ -416,6 +417,7 @@
416417
"additionalProperties": false
417418
},
418419
{
420+
"description": "Use this to set both timestamp and block timeout. The package then times out once the first of both timeouts is hit.",
419421
"type": "object",
420422
"required": [
421423
"both"

contracts/ibc-reflect/schema/packet_msg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,10 @@
387387
]
388388
},
389389
"IbcTimeout": {
390+
"description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.",
390391
"anyOf": [
391392
{
392-
"description": "block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain) See https://golang.org/pkg/time/#Time.UnixNano",
393+
"description": "Block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain).",
393394
"type": "object",
394395
"required": [
395396
"timestamp"
@@ -402,7 +403,7 @@
402403
"additionalProperties": false
403404
},
404405
{
405-
"description": "block after which the packet times out (measured on remote chain)",
406+
"description": "Block after which the packet times out (measured on remote chain).",
406407
"type": "object",
407408
"required": [
408409
"block"
@@ -415,6 +416,7 @@
415416
"additionalProperties": false
416417
},
417418
{
419+
"description": "Use this to set both timestamp and block timeout. The package then times out once the first of both timeouts is hit.",
418420
"type": "object",
419421
"required": [
420422
"both"

contracts/reflect/schema/execute_msg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,10 @@
431431
]
432432
},
433433
"IbcTimeout": {
434+
"description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.",
434435
"anyOf": [
435436
{
436-
"description": "block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain) See https://golang.org/pkg/time/#Time.UnixNano",
437+
"description": "Block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain).",
437438
"type": "object",
438439
"required": [
439440
"timestamp"
@@ -446,7 +447,7 @@
446447
"additionalProperties": false
447448
},
448449
{
449-
"description": "block after which the packet times out (measured on remote chain)",
450+
"description": "Block after which the packet times out (measured on remote chain).",
450451
"type": "object",
451452
"required": [
452453
"block"
@@ -459,6 +460,7 @@
459460
"additionalProperties": false
460461
},
461462
{
463+
"description": "Use this to set both timestamp and block timeout. The package then times out once the first of both timeouts is hit.",
462464
"type": "object",
463465
"required": [
464466
"both"

contracts/reflect/schema/response_for__custom_msg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,10 @@
419419
]
420420
},
421421
"IbcTimeout": {
422+
"description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.",
422423
"anyOf": [
423424
{
424-
"description": "block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain) See https://golang.org/pkg/time/#Time.UnixNano",
425+
"description": "Block timestamp (nanoseconds since UNIX epoch) after which the packet times out (measured on the remote chain).",
425426
"type": "object",
426427
"required": [
427428
"timestamp"
@@ -434,7 +435,7 @@
434435
"additionalProperties": false
435436
},
436437
{
437-
"description": "block after which the packet times out (measured on remote chain)",
438+
"description": "Block after which the packet times out (measured on remote chain).",
438439
"type": "object",
439440
"required": [
440441
"block"
@@ -447,6 +448,7 @@
447448
"additionalProperties": false
448449
},
449450
{
451+
"description": "Use this to set both timestamp and block timeout. The package then times out once the first of both timeouts is hit.",
450452
"type": "object",
451453
"required": [
452454
"both"

packages/std/src/ibc.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,19 @@ pub struct IbcEndpoint {
5454
pub channel_id: String,
5555
}
5656

57+
/// In IBC each package must set at least one type of timeout:
58+
/// the timestamp or the block height. Using this rather complex enum instead of
59+
/// two timeout fields we ensure that at least one timeout is set.
5760
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
5861
#[serde(rename_all = "snake_case")]
5962
pub enum IbcTimeout {
60-
/// block timestamp (nanoseconds since UNIX epoch) after which the packet times out
61-
/// (measured on the remote chain)
62-
/// See https://golang.org/pkg/time/#Time.UnixNano
63+
/// Block timestamp (nanoseconds since UNIX epoch) after which the packet times out
64+
/// (measured on the remote chain).
6365
Timestamp(Timestamp),
64-
/// block after which the packet times out (measured on remote chain)
66+
/// Block after which the packet times out (measured on remote chain).
6567
Block(IbcTimeoutBlock),
68+
/// Use this to set both timestamp and block timeout. The package then times out once
69+
/// the first of both timeouts is hit.
6670
Both {
6771
timestamp: Timestamp,
6872
block: IbcTimeoutBlock,

0 commit comments

Comments
 (0)