From 0394174ac95d670129eb78295085580ab695add5 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Fri, 15 Sep 2023 13:15:11 +0200 Subject: [PATCH 1/5] Remove old ibc functionality --- packages/std/src/exports.rs | 9 ++++----- packages/std/src/ibc.rs | 21 --------------------- packages/std/src/lib.rs | 8 +++++--- packages/std/src/testing/mock.rs | 25 ++++++++++++------------- packages/std/src/testing/mod.rs | 4 +++- packages/vm/src/calls.rs | 4 +++- 6 files changed, 27 insertions(+), 44 deletions(-) diff --git a/packages/std/src/exports.rs b/packages/std/src/exports.rs index c745bc82e7..279b9d8bb3 100644 --- a/packages/std/src/exports.rs +++ b/packages/std/src/exports.rs @@ -15,9 +15,8 @@ use serde::de::DeserializeOwned; use crate::deps::OwnedDeps; #[cfg(feature = "stargate")] use crate::ibc::{ - IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, - IbcChannelOpenResponse, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, - IbcReceiveResponse, + IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcPacketAckMsg, + IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, }; use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; use crate::memory::{alloc, consume_region, release_buffer, Region}; @@ -531,10 +530,10 @@ where #[cfg(feature = "stargate")] fn _do_ibc_channel_open( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result<(), E>, env_ptr: *mut Region, msg_ptr: *mut Region, -) -> ContractResult +) -> ContractResult<()> where Q: CustomQuery, E: ToString, diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 6631312527..121ba7e262 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -299,9 +299,6 @@ impl From for IbcChannel { } } -/// Note that this serializes as "null". -#[cfg(not(feature = "ibc3"))] -pub type IbcChannelOpenResponse = (); /// This serializes either as "null" or a JSON object. #[cfg(feature = "ibc3")] pub type IbcChannelOpenResponse = Option; @@ -410,11 +407,6 @@ pub struct IbcPacketReceiveMsg { } impl IbcPacketReceiveMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(packet: IbcPacket) -> Self { - Self { packet } - } - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } @@ -432,14 +424,6 @@ pub struct IbcPacketAckMsg { } impl IbcPacketAckMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(acknowledgement: IbcAcknowledgement, original_packet: IbcPacket) -> Self { - Self { - acknowledgement, - original_packet, - } - } - #[cfg(feature = "ibc3")] pub fn new( acknowledgement: IbcAcknowledgement, @@ -464,11 +448,6 @@ pub struct IbcPacketTimeoutMsg { } impl IbcPacketTimeoutMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(packet: IbcPacket) -> Self { - Self { packet } - } - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } diff --git a/packages/std/src/lib.rs b/packages/std/src/lib.rs index ea04f23dc1..00332fe0db 100644 --- a/packages/std/src/lib.rs +++ b/packages/std/src/lib.rs @@ -51,11 +51,13 @@ pub use crate::errors::{ VerificationError, }; pub use crate::hex_binary::HexBinary; +#[cfg(feature = "ibc3")] +pub use crate::ibc::IbcChannelOpenResponse; pub use crate::ibc::{ Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcBasicResponse, IbcChannel, IbcChannelCloseMsg, - IbcChannelConnectMsg, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcEndpoint, IbcMsg, IbcOrder, - IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, - IbcTimeout, IbcTimeoutBlock, + IbcChannelConnectMsg, IbcChannelOpenMsg, IbcEndpoint, IbcMsg, IbcOrder, IbcPacket, + IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, IbcTimeout, + IbcTimeoutBlock, }; #[cfg(feature = "iterator")] pub use crate::iterator::{Order, Record}; diff --git a/packages/std/src/testing/mock.rs b/packages/std/src/testing/mock.rs index 4218f729f5..1e13b04b1f 100644 --- a/packages/std/src/testing/mock.rs +++ b/packages/std/src/testing/mock.rs @@ -4,7 +4,7 @@ use core::marker::PhantomData; #[cfg(feature = "cosmwasm_1_3")] use core::ops::Bound; use serde::de::DeserializeOwned; -#[cfg(feature = "stargate")] +#[cfg(feature = "ibc3")] use serde::Serialize; use sha2::{Digest, Sha256}; #[cfg(feature = "cosmwasm_1_3")] @@ -16,12 +16,15 @@ use crate::binary::Binary; use crate::coin::Coin; use crate::deps::OwnedDeps; use crate::errors::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; -#[cfg(feature = "stargate")] +#[cfg(feature = "ibc3")] use crate::ibc::{ - IbcAcknowledgement, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, - IbcEndpoint, IbcOrder, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, + IbcAcknowledgement, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcTimeoutBlock, }; +#[cfg(feature = "stargate")] +use crate::ibc::{ + IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcEndpoint, IbcOrder, +}; use crate::math::Uint128; #[cfg(feature = "cosmwasm_1_1")] use crate::query::SupplyResponse; @@ -410,7 +413,7 @@ pub fn mock_ibc_channel_close_confirm( /// Creates a IbcPacketReceiveMsg for testing ibc_packet_receive. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields -#[cfg(feature = "stargate")] +#[cfg(feature = "ibc3")] pub fn mock_ibc_packet_recv( my_channel_id: &str, data: &impl Serialize, @@ -441,7 +444,7 @@ pub fn mock_ibc_packet_recv( /// Creates a IbcPacket for testing ibc_packet_{ack,timeout}. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields. /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest. -#[cfg(feature = "stargate")] +#[cfg(feature = "ibc3")] fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult { Ok(IbcPacket { data: to_json_binary(data)?, @@ -465,7 +468,7 @@ fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult StdResult { let packet = mock_ibc_packet(my_channel_id, data)?; - Ok(IbcPacketTimeoutMsg::new( - packet, - #[cfg(feature = "ibc3")] - Addr::unchecked("relayer"), - )) + Ok(IbcPacketTimeoutMsg::new(packet, Addr::unchecked("relayer"))) } /// The same type as cosmwasm-std's QuerierResult, but easier to reuse in diff --git a/packages/std/src/testing/mod.rs b/packages/std/src/testing/mod.rs index 14b362ce42..7977061e49 100644 --- a/packages/std/src/testing/mod.rs +++ b/packages/std/src/testing/mod.rs @@ -24,6 +24,8 @@ pub use mock::{ pub use mock::{ mock_ibc_channel, mock_ibc_channel_close_confirm, mock_ibc_channel_close_init, mock_ibc_channel_connect_ack, mock_ibc_channel_connect_confirm, mock_ibc_channel_open_init, - mock_ibc_channel_open_try, mock_ibc_packet_ack, mock_ibc_packet_recv, mock_ibc_packet_timeout, + mock_ibc_channel_open_try, }; +#[cfg(feature = "ibc3")] +pub use mock::{mock_ibc_packet_ack, mock_ibc_packet_recv, mock_ibc_packet_timeout}; pub use shuffle::riffle_shuffle; diff --git a/packages/vm/src/calls.rs b/packages/vm/src/calls.rs index 5828b02102..334c38ded6 100644 --- a/packages/vm/src/calls.rs +++ b/packages/vm/src/calls.rs @@ -825,9 +825,11 @@ mod tests { use crate::testing::{ mock_env, mock_info, mock_instance, MockApi, MockQuerier, MockStorage, }; + #[cfg(feature = "ibc3")] + use cosmwasm_std::testing::mock_ibc_packet_timeout; use cosmwasm_std::testing::{ mock_ibc_channel_close_init, mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, - mock_ibc_packet_ack, mock_ibc_packet_recv, mock_ibc_packet_timeout, mock_wasmd_attr, + mock_ibc_packet_ack, mock_ibc_packet_recv, mock_wasmd_attr, }; use cosmwasm_std::{ Empty, Event, IbcAcknowledgement, IbcOrder, Reply, ReplyOn, SubMsgResponse, From 6ac80d49394268ecd8edcd3c43ebb4edbcf9bdad Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 18 Sep 2023 10:48:39 +0200 Subject: [PATCH 2/5] Remove ibc3 feature --- contracts/ibc-reflect-send/src/ibc.rs | 17 ++++++++++++----- contracts/ibc-reflect/Cargo.toml | 2 +- docs/USING_COSMWASM_STD.md | 1 - packages/go-gen/Cargo.toml | 2 +- packages/std/Cargo.toml | 5 +---- packages/std/src/exports.rs | 8 ++++---- packages/std/src/ibc.rs | 8 -------- packages/std/src/lib.rs | 1 - packages/std/src/testing/mock.rs | 16 +++++++--------- packages/std/src/testing/mod.rs | 4 +--- packages/vm/Cargo.toml | 2 +- packages/vm/src/calls.rs | 1 - 12 files changed, 28 insertions(+), 39 deletions(-) diff --git a/contracts/ibc-reflect-send/src/ibc.rs b/contracts/ibc-reflect-send/src/ibc.rs index 511a7b1518..0dadfb53fb 100644 --- a/contracts/ibc-reflect-send/src/ibc.rs +++ b/contracts/ibc-reflect-send/src/ibc.rs @@ -1,7 +1,8 @@ use cosmwasm_std::{ - entry_point, from_json, to_json_binary, DepsMut, Env, IbcBasicResponse, IbcChannelCloseMsg, - IbcChannelConnectMsg, IbcChannelOpenMsg, IbcMsg, IbcOrder, IbcPacketAckMsg, - IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, Never, StdError, StdResult, + entry_point, from_json, to_json_binary, DepsMut, Env, Ibc3ChannelOpenResponse, + IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, + IbcChannelOpenResponse, IbcMsg, IbcOrder, IbcPacketAckMsg, IbcPacketReceiveMsg, + IbcPacketTimeoutMsg, IbcReceiveResponse, Never, StdError, StdResult, }; use crate::ibc_msg::{ @@ -17,7 +18,11 @@ pub const PACKET_LIFETIME: u64 = 60 * 60; #[entry_point] /// enforces ordering and versioing constraints -pub fn ibc_channel_open(_deps: DepsMut, _env: Env, msg: IbcChannelOpenMsg) -> StdResult<()> { +pub fn ibc_channel_open( + _deps: DepsMut, + _env: Env, + msg: IbcChannelOpenMsg, +) -> StdResult { let channel = msg.channel(); if channel.order != IbcOrder::Ordered { @@ -37,7 +42,9 @@ pub fn ibc_channel_open(_deps: DepsMut, _env: Env, msg: IbcChannelOpenMsg) -> St } } - Ok(()) + Ok(Some(Ibc3ChannelOpenResponse { + version: IBC_APP_VERSION.to_string(), + })) } #[entry_point] diff --git a/contracts/ibc-reflect/Cargo.toml b/contracts/ibc-reflect/Cargo.toml index ead27d3725..cd16b206e3 100644 --- a/contracts/ibc-reflect/Cargo.toml +++ b/contracts/ibc-reflect/Cargo.toml @@ -33,7 +33,7 @@ backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator", "ibc3"] } +cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate"] } schemars = "0.8.3" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/docs/USING_COSMWASM_STD.md b/docs/USING_COSMWASM_STD.md index 19a04bdb66..49cf3511d4 100644 --- a/docs/USING_COSMWASM_STD.md +++ b/docs/USING_COSMWASM_STD.md @@ -39,7 +39,6 @@ The libarary comes with the following features: | iterator | x | Storage iterators | | abort | x | A panic handler that aborts the contract execution with a helpful message | | stargate | | Cosmos SDK 0.40+ features and IBC | -| ibc3 | | New fields added in IBC v3 | | staking | | Access to the staking module | | backtraces | | Add backtraces to errors (for unit testing) | | cosmwasm_1_1 | | Features that require CosmWasm 1.1+ on the chain | diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml index 12035ed5a0..8e5ef67d65 100644 --- a/packages/go-gen/Cargo.toml +++ b/packages/go-gen/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] schemars = "0.8.3" -cosmwasm-std = { path = "../std", version = "1.5.0", features = ["cosmwasm_1_4", "staking", "stargate", "ibc3"] } +cosmwasm-std = { path = "../std", version = "1.5.0", features = ["cosmwasm_1_4", "staking", "stargate"] } cosmwasm-schema = { path = "../schema", version = "1.5.0" } anyhow = "1" Inflector = "0.11.4" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index aa3f92219a..2ab60fcb5f 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" readme = "README.md" [package.metadata.docs.rs] -features = ["abort", "stargate", "staking", "ibc3", "cosmwasm_1_4"] +features = ["abort", "stargate", "staking", "cosmwasm_1_4"] [features] default = ["iterator", "abort"] @@ -30,9 +30,6 @@ backtraces = [] # stargate enables stargate-dependent messages and queries, like raw protobuf messages # as well as ibc-related functionality stargate = [] -# ibc3 extends ibc messages with ibc-v3 only features. This should only be enabled on contracts -# that require these types. Without this, they get the smaller ibc-v1 API. -ibc3 = ["stargate"] # This feature makes `BankQuery::Supply` available for the contract to call, but requires # the host blockchain to run CosmWasm `1.1.0` or higher. cosmwasm_1_1 = [] diff --git a/packages/std/src/exports.rs b/packages/std/src/exports.rs index 279b9d8bb3..9cbd92fb8e 100644 --- a/packages/std/src/exports.rs +++ b/packages/std/src/exports.rs @@ -15,9 +15,10 @@ use serde::de::DeserializeOwned; use crate::deps::OwnedDeps; #[cfg(feature = "stargate")] use crate::ibc::{ - IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcPacketAckMsg, + IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, }; +use crate::ibc::{IbcChannelOpenMsg, IbcChannelOpenResponse}; use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; use crate::memory::{alloc, consume_region, release_buffer, Region}; #[cfg(feature = "abort")] @@ -528,12 +529,11 @@ where query_fn(deps.as_ref(), env, msg).into() } -#[cfg(feature = "stargate")] fn _do_ibc_channel_open( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result<(), E>, + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, env_ptr: *mut Region, msg_ptr: *mut Region, -) -> ContractResult<()> +) -> ContractResult where Q: CustomQuery, E: ToString, diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 121ba7e262..b9ccbe5dc7 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -5,7 +5,6 @@ use core::cmp::{Ord, Ordering, PartialOrd}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ibc3")] use crate::addresses::Addr; use crate::binary::Binary; use crate::coin::Coin; @@ -300,7 +299,6 @@ impl From for IbcChannel { } /// This serializes either as "null" or a JSON object. -#[cfg(feature = "ibc3")] pub type IbcChannelOpenResponse = Option; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -402,12 +400,10 @@ impl From for IbcChannel { #[non_exhaustive] pub struct IbcPacketReceiveMsg { pub packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketReceiveMsg { - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } } @@ -419,12 +415,10 @@ impl IbcPacketReceiveMsg { pub struct IbcPacketAckMsg { pub acknowledgement: IbcAcknowledgement, pub original_packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketAckMsg { - #[cfg(feature = "ibc3")] pub fn new( acknowledgement: IbcAcknowledgement, original_packet: IbcPacket, @@ -443,12 +437,10 @@ impl IbcPacketAckMsg { #[non_exhaustive] pub struct IbcPacketTimeoutMsg { pub packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketTimeoutMsg { - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } } diff --git a/packages/std/src/lib.rs b/packages/std/src/lib.rs index 00332fe0db..df60c6debc 100644 --- a/packages/std/src/lib.rs +++ b/packages/std/src/lib.rs @@ -51,7 +51,6 @@ pub use crate::errors::{ VerificationError, }; pub use crate::hex_binary::HexBinary; -#[cfg(feature = "ibc3")] pub use crate::ibc::IbcChannelOpenResponse; pub use crate::ibc::{ Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcBasicResponse, IbcChannel, IbcChannelCloseMsg, diff --git a/packages/std/src/testing/mock.rs b/packages/std/src/testing/mock.rs index 1e13b04b1f..fd9ea4a1d5 100644 --- a/packages/std/src/testing/mock.rs +++ b/packages/std/src/testing/mock.rs @@ -4,7 +4,7 @@ use core::marker::PhantomData; #[cfg(feature = "cosmwasm_1_3")] use core::ops::Bound; use serde::de::DeserializeOwned; -#[cfg(feature = "ibc3")] +#[cfg(feature = "stargate")] use serde::Serialize; use sha2::{Digest, Sha256}; #[cfg(feature = "cosmwasm_1_3")] @@ -16,7 +16,7 @@ use crate::binary::Binary; use crate::coin::Coin; use crate::deps::OwnedDeps; use crate::errors::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; -#[cfg(feature = "ibc3")] +#[cfg(feature = "stargate")] use crate::ibc::{ IbcAcknowledgement, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcTimeoutBlock, @@ -413,7 +413,7 @@ pub fn mock_ibc_channel_close_confirm( /// Creates a IbcPacketReceiveMsg for testing ibc_packet_receive. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields -#[cfg(feature = "ibc3")] +#[cfg(feature = "stargate")] pub fn mock_ibc_packet_recv( my_channel_id: &str, data: &impl Serialize, @@ -436,7 +436,6 @@ pub fn mock_ibc_packet_recv( } .into(), }, - #[cfg(feature = "ibc3")] Addr::unchecked("relayer"), )) } @@ -444,7 +443,7 @@ pub fn mock_ibc_packet_recv( /// Creates a IbcPacket for testing ibc_packet_{ack,timeout}. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields. /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest. -#[cfg(feature = "ibc3")] +#[cfg(feature = "stargate")] fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult { Ok(IbcPacket { data: to_json_binary(data)?, @@ -468,7 +467,7 @@ fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult Date: Fri, 3 Nov 2023 10:08:10 +0100 Subject: [PATCH 3/5] Merge imports --- packages/std/src/testing/mock.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/std/src/testing/mock.rs b/packages/std/src/testing/mock.rs index fd9ea4a1d5..2db41403d5 100644 --- a/packages/std/src/testing/mock.rs +++ b/packages/std/src/testing/mock.rs @@ -18,13 +18,10 @@ use crate::deps::OwnedDeps; use crate::errors::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; #[cfg(feature = "stargate")] use crate::ibc::{ - IbcAcknowledgement, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, + IbcAcknowledgement, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, + IbcEndpoint, IbcOrder, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcTimeoutBlock, }; -#[cfg(feature = "stargate")] -use crate::ibc::{ - IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcEndpoint, IbcOrder, -}; use crate::math::Uint128; #[cfg(feature = "cosmwasm_1_1")] use crate::query::SupplyResponse; From 350879fad30ce3581069d2badf42e653dfb5e331 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Fri, 3 Nov 2023 11:54:19 +0100 Subject: [PATCH 4/5] Add IbcChannelOpenResponse docs --- packages/std/src/ibc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index b9ccbe5dc7..ceba3ad015 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -298,7 +298,9 @@ impl From for IbcChannel { } } -/// This serializes either as "null" or a JSON object. +/// This serializes either as `null` or a JSON object. +/// Within the response, a channel version can be specified. +/// If `null` is provided instead, the incoming channel version is accepted. pub type IbcChannelOpenResponse = Option; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From 37351f1931234e19da98a4a0e224c0561812d721 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Tue, 7 Nov 2023 10:51:57 +0100 Subject: [PATCH 5/5] Add changelog and migrating entry --- CHANGELOG.md | 2 ++ MIGRATING.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00f9418771..058d3a6817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,10 @@ and this project adheres to - cosmwasm-std: Make inner values of `CanonicalAddr` and `Binary` private and add constructor for `Binary`. ([#1876]) - cosmwasm-vm: Make inner value of `Size` private and add constructor. ([#1876]) +- cosmwasm-std: Remove old IBC version and make v3 the default. ([#1875]) [#1874]: https://github.com/CosmWasm/cosmwasm/pull/1874 +[#1875]: https://github.com/CosmWasm/cosmwasm/pull/1875 [#1876]: https://github.com/CosmWasm/cosmwasm/pull/1876 [#1878]: https://github.com/CosmWasm/cosmwasm/pull/1878 [#1879]: https://github.com/CosmWasm/cosmwasm/pull/1879 diff --git a/MIGRATING.md b/MIGRATING.md index f367462f30..30b18953f9 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -19,6 +19,10 @@ major releases of `cosmwasm`. Note that you can also view the # ... ``` + If you were using cosmwasm-std's `ibc3` feature, you can remove it, as it is + the default now. Depending on your usage, you might have to enable the + `stargate` feature instead, since it was previously implied by `ibc3`. + - `ContractInfoResponse::new` now takes all fields of the response as parameters: