From 259ac5daae707f1e2ae37ba63b30532b65f03b9c Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 16 Oct 2023 16:12:15 +0200 Subject: [PATCH] Adjust WriteAcknowledgement fields to other msgs --- .../schema/ibc-reflect-send.json | 40 +++---------------- .../schema/ibc/packet_msg.json | 40 +++---------------- .../ibc-reflect-send/schema/raw/execute.json | 40 +++---------------- .../ibc-reflect/schema/ibc/packet_msg.json | 40 +++---------------- contracts/reflect/schema/raw/execute.json | 40 +++---------------- contracts/reflect/schema/reflect.json | 40 +++---------------- packages/std/src/ibc.rs | 6 +-- 7 files changed, 33 insertions(+), 213 deletions(-) diff --git a/contracts/ibc-reflect-send/schema/ibc-reflect-send.json b/contracts/ibc-reflect-send/schema/ibc-reflect-send.json index 4131989a5f..827d0ada25 100644 --- a/contracts/ibc-reflect-send/schema/ibc-reflect-send.json +++ b/contracts/ibc-reflect-send/schema/ibc-reflect-send.json @@ -396,32 +396,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -543,20 +517,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/contracts/ibc-reflect-send/schema/ibc/packet_msg.json b/contracts/ibc-reflect-send/schema/ibc/packet_msg.json index 532f0faed7..ededca70e2 100644 --- a/contracts/ibc-reflect-send/schema/ibc/packet_msg.json +++ b/contracts/ibc-reflect-send/schema/ibc/packet_msg.json @@ -334,32 +334,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -481,20 +455,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/contracts/ibc-reflect-send/schema/raw/execute.json b/contracts/ibc-reflect-send/schema/raw/execute.json index 51cc9d0155..60d66c8796 100644 --- a/contracts/ibc-reflect-send/schema/raw/execute.json +++ b/contracts/ibc-reflect-send/schema/raw/execute.json @@ -385,32 +385,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -532,20 +506,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/contracts/ibc-reflect/schema/ibc/packet_msg.json b/contracts/ibc-reflect/schema/ibc/packet_msg.json index 875e1b3f81..6f279ab571 100644 --- a/contracts/ibc-reflect/schema/ibc/packet_msg.json +++ b/contracts/ibc-reflect/schema/ibc/packet_msg.json @@ -321,32 +321,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -468,20 +442,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/contracts/reflect/schema/raw/execute.json b/contracts/reflect/schema/raw/execute.json index a7b0471a30..4a128a6f5c 100644 --- a/contracts/reflect/schema/raw/execute.json +++ b/contracts/reflect/schema/raw/execute.json @@ -439,32 +439,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -586,20 +560,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/contracts/reflect/schema/reflect.json b/contracts/reflect/schema/reflect.json index 1a8c7b701c..0ea360415b 100644 --- a/contracts/reflect/schema/reflect.json +++ b/contracts/reflect/schema/reflect.json @@ -449,32 +449,6 @@ } ] }, - "IbcAcknowledgement": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/Binary" - } - } - }, - "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": [ @@ -596,20 +570,16 @@ "type": "object", "required": [ "ack", - "dest_channel", + "channel_id", "sequence" ], "properties": { "ack": { - "$ref": "#/definitions/IbcAcknowledgement" + "$ref": "#/definitions/Binary" }, - "dest_channel": { - "description": "The channel on the destination chain (the chain this is executed on) to write the acknowledgement to.", - "allOf": [ - { - "$ref": "#/definitions/IbcEndpoint" - } - ] + "channel_id": { + "description": "The local channel (on the chain this is executed on) to write the acknowledgement to.", + "type": "string" }, "sequence": { "description": "The sequence number of the packet to acknowledge.", diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 355afe4199..dfabf73d60 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -54,12 +54,12 @@ 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 { - /// The channel on the destination chain (the chain this is executed on) + /// The local channel (on the chain this is executed on) /// to write the acknowledgement to. - dest_channel: IbcEndpoint, + channel_id: String, /// The sequence number of the packet to acknowledge. sequence: u64, - ack: IbcAcknowledgement, + ack: Binary, }, }