Skip to content

Commit

Permalink
Update CosmWasm dependencies to v2 (#1251)
Browse files Browse the repository at this point in the history
* Update cosmwasm dependencies

* Update cosmwasm deps versions

* Remove unnecessary lifetime

* Remove call to deprecated `mock_info` function

* Format cargo.toml file

* update cw in cw-check

* update cargo lockfiles

* cw v1.5 compatiblity is fixed in v2.0.4

* need std feature

---------

Co-authored-by: Ranadeep Biswas <[email protected]>
  • Loading branch information
seanchen1991 and rnbguy authored Jun 6, 2024
1 parent ea662dc commit 1ca0371
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 36 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ members = [
# internal crates that are not published
"tests-integration",
]

exclude = [
"ci/cw-check",
"ci/no-std-check",
Expand Down Expand Up @@ -105,8 +106,7 @@ ibc-client-tendermint-types = { version = "0.53.0", path = "./ibc-clients/ics07-
ibc-client-wasm-types = { version = "0.53.0", path = "./ibc-clients/ics08-wasm/types", default-features = false }
ibc-app-transfer-types = { version = "0.53.0", path = "./ibc-apps/ics20-transfer/types", default-features = false }
ibc-app-nft-transfer-types = { version = "0.53.0", path = "./ibc-apps/ics721-nft-transfer/types", default-features = false }

ibc-proto = { version = "0.45.0", default-features = false }
ibc-proto = { version = "0.45.0", default-features = false }

# cosmos dependencies
tendermint = { version = "0.36.0", default-features = false }
Expand All @@ -120,10 +120,10 @@ tendermint-testgen = { version = "0.36.0", default-features = fals
### Note: Kept at the following version to match the CosmWasm module version
### used by chains supporting the wasm-enabled version of ibc-go v7.3
### (This is the min version of `ibc-go` that supports `08-wasm` light clients)
cosmwasm-schema = { version = "1.5.4" }
cosmwasm-std = { version = "1.5.4" }
cosmwasm-vm = { version = "1.5.4" }
cw-storage-plus = { version = "1.2.0" }
cosmwasm-schema = { version = "2.0.4" }
cosmwasm-std = { version = "2.0.4" }
cosmwasm-vm = { version = "2.0.4" }
cw-storage-plus = { version = "2.0.0" }

# parity dependencies
parity-scale-codec = { version = "3.6.5", default-features = false, features = [ "derive" ] }
Expand Down
40 changes: 15 additions & 25 deletions ci/cw-check/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ci/cw-check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ crate-type = [ "cdylib", "rlib" ]
[dependencies]
ibc-apps = { path = "../../ibc-apps", default-features = false, features = [ "serde", "parity-scale-codec" ] }
ibc-core = { path = "../../ibc-core", features = [ "serde", "parity-scale-codec", "schema" ] }
cosmwasm-std = { version = "1.5.4", default-features = false }
cosmwasm-schema = { version = "1.5.4", default-features = false }
cosmwasm-std = { version = "2.0.4", default-features = false, features = [ "std" ] }
cosmwasm-schema = { version = "2.0.4", default-features = false }
serde-json = { package = "serde-json-wasm", version = "^1.0.1", default-features = false }
thiserror = { version = "^1.0", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion ibc-clients/cw-context/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Checksum = Vec<u8>;
/// - Only a sorted set is needed. So the value type is set to
/// [`Empty`] following
/// ([cosmwasm-book](https://book.cosmwasm.com/cross-contract/map-storage.html#maps-as-sets)).
pub const CONSENSUS_STATE_HEIGHT_MAP: Map<'_, (u64, u64), Empty> =
pub const CONSENSUS_STATE_HEIGHT_MAP: Map<(u64, u64), Empty> =
Map::new(ITERATE_CONSENSUS_STATE_PREFIX);

/// Context is a wrapper around the deps and env that provides access
Expand Down
7 changes: 5 additions & 2 deletions tests-integration/tests/cosmwasm/helper.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
use std::str::FromStr;

use cosmwasm_std::testing::{mock_env, mock_info};
use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env};
use cosmwasm_std::{coins, Env, MessageInfo, Timestamp as CwTimestamp};
use ibc::clients::tendermint::types::ConsensusState;
use ibc::core::primitives::Timestamp as IbcTimestamp;
use tendermint::Hash;

pub fn dummy_msg_info() -> MessageInfo {
mock_info("creator", &coins(1000, "ibc"))
let deps = mock_dependencies();
let creator = deps.api.addr_make("creator");

message_info(&creator, &coins(1000, "ibc"))
}

pub fn dummy_checksum() -> Vec<u8> {
Expand Down

0 comments on commit 1ca0371

Please sign in to comment.