Skip to content

Commit

Permalink
Adjust WriteAcknowledgement fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Oct 13, 2023
1 parent 7bb610b commit 068845a
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 19 deletions.
33 changes: 30 additions & 3 deletions contracts/ibc-reflect-send/schema/ibc-reflect-send.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -518,14 +533,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions contracts/ibc-reflect-send/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -456,14 +471,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions contracts/ibc-reflect-send/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -507,14 +522,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions contracts/ibc-reflect/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -443,14 +458,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions contracts/reflect/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -561,14 +576,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions contracts/reflect/schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,21 @@
}
}
},
"IbcEndpoint": {
"type": "object",
"required": [
"channel_id",
"port_id"
],
"properties": {
"channel_id": {
"type": "string"
},
"port_id": {
"type": "string"
}
}
},
"IbcMsg": {
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
"oneOf": [
Expand Down Expand Up @@ -571,14 +586,26 @@
"type": "object",
"required": [
"ack",
"packet_id"
"dest_channel",
"sequence"
],
"properties": {
"ack": {
"$ref": "#/definitions/IbcAcknowledgement"
},
"packet_id": {
"type": "string"
"dest_channel": {
"description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.",
"allOf": [
{
"$ref": "#/definitions/IbcEndpoint"
}
]
},
"sequence": {
"description": "The sequence number of the packet to acknowledge.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ pub enum IbcMsg {
/// In this case, you can return an [`IbcReceiveResponse`] with an acknowledgement of `None`
/// from `ibc_packet_receive` and call this message later.
WriteAcknowledgement {
packet_id: String,
/// The channel on the destination chain (the chain this is executed on)
/// to write the acknowledgement to.
dest_channel: IbcEndpoint,
/// The sequence number of the packet to acknowledge.
sequence: u64,
ack: IbcAcknowledgement,
},
}
Expand Down

0 comments on commit 068845a

Please sign in to comment.