diff --git a/packages/osmosis-test-tube/Cargo.toml b/packages/osmosis-test-tube/Cargo.toml index c6810b4..9c7d1d9 100644 --- a/packages/osmosis-test-tube/Cargo.toml +++ b/packages/osmosis-test-tube/Cargo.toml @@ -4,22 +4,22 @@ edition = "2021" license = "MIT OR Apache-2.0" name = "osmosis-test-tube" repository = "https://github.com/osmosis-labs/test-tube" -version = "25.0.0" +version = "26.0.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html exclude = ["osmosis", "test_artifacts"] [dependencies] -base64 = "0.21.5" -cosmrs = { version = "0.15.0", features = ["cosmwasm"] } -cosmwasm-std = "1.5.5" -osmosis-std = "0.25.0" -prost = "0.12.3" +base64 = "0.22.1" +cosmrs = {version = "0.20.0", features = ["cosmwasm"]} +cosmwasm-std = "2.1" +osmosis-std = "0.26.0" +prost = "0.13.3" serde = "1.0.144" serde_json = "1.0.85" -test-tube = { version = "0.7.0", path = "../test-tube", features = [ - "module-wrappers", -] } +test-tube = {version = "0.8.0", path = "../test-tube", features = [ + "module-wrappers", +]} thiserror = "1.0.34" [features] @@ -27,9 +27,9 @@ default = [] wasm-sudo = ["test-tube/wasm-sudo"] [build-dependencies] -bindgen = "0.69.1" +bindgen = "0.70.1" [dev-dependencies] -cw1-whitelist = "1.1.1" +cw1-whitelist = "2.0.0" rayon = "1.5.3" -simple-sudo = { path = "../../test_contracts/simple-sudo" } +simple-sudo = {path = "../../test_contracts/simple-sudo"} diff --git a/packages/osmosis-test-tube/build.rs b/packages/osmosis-test-tube/build.rs index ed64cfa..f2330b8 100644 --- a/packages/osmosis-test-tube/build.rs +++ b/packages/osmosis-test-tube/build.rs @@ -1,5 +1,3 @@ -extern crate core; - use std::{env, path::PathBuf, process::Command}; fn main() { diff --git a/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs b/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs index 82778f3..1778c4e 100644 --- a/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs +++ b/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs @@ -149,12 +149,16 @@ mod tests { title: "Create concentrated uosmo:usdc pool".to_string(), description: "Create concentrated uosmo:usdc pool, so that we can trade it" .to_string(), - pool_records: vec![PoolRecord { - denom0: denom0.clone(), - denom1: "uosmo".to_string(), - tick_spacing: 1, - spread_factor: "0".to_string(), - }], + pool_records: vec![ + #[allow(deprecated)] + PoolRecord { + denom0: denom0.clone(), + denom1: "uosmo".to_string(), + tick_spacing: 1, + spread_factor: "0".to_string(), + exponent_at_price_one: "0".to_string(), // DEPRECATED + }, + ], }, signer.address(), &signer, diff --git a/packages/osmosis-test-tube/src/module/pool_manager.rs b/packages/osmosis-test-tube/src/module/pool_manager.rs index 7429dea..ce43c48 100644 --- a/packages/osmosis-test-tube/src/module/pool_manager.rs +++ b/packages/osmosis-test-tube/src/module/pool_manager.rs @@ -195,12 +195,16 @@ mod tests { title: "Create concentrated uosmo:usdc pool".to_string(), description: "Create concentrated uosmo:usdc pool, so that we can trade it" .to_string(), - pool_records: vec![PoolRecord { - denom0: denom0.clone(), - denom1: "uosmo".to_string(), - tick_spacing: 100, - spread_factor: "0".to_string(), - }], + pool_records: vec![ + #[allow(deprecated)] + PoolRecord { + denom0: denom0.clone(), + denom1: "uosmo".to_string(), + tick_spacing: 100, + spread_factor: "0".to_string(), + exponent_at_price_one: "0".to_string(), // DEPRECATED + }, + ], }, signer.address(), &signer, @@ -293,6 +297,7 @@ mod tests { token_out_denom: "uosmo".to_string(), }], token_in: format!("{}{}", "1000000", denom0), + sender: trader.address(), }) .unwrap(); let expected_token_out = res.token_out_amount; diff --git a/packages/osmosis-test-tube/src/runner/app.rs b/packages/osmosis-test-tube/src/runner/app.rs index 3c03552..9cf49a3 100644 --- a/packages/osmosis-test-tube/src/runner/app.rs +++ b/packages/osmosis-test-tube/src/runner/app.rs @@ -169,13 +169,17 @@ impl OsmosisTestApp { where I: IntoIterator, { + let ext = TxExtension { + selected_authenticators: selected_authenticators.to_vec(), + } + .to_any(); + let ext_ops = vec![cosmrs::Any { + type_url: ext.type_url, + value: ext.value, + }]; let tx_body = tx::Body { messages: msgs.into_iter().map(Into::into).collect(), - non_critical_extension_options: vec![TxExtension { - selected_authenticators: selected_authenticators.to_vec(), - } - .to_any() - .into()], + non_critical_extension_options: ext_ops, ..Default::default() }; @@ -534,6 +538,7 @@ mod tests { .query_all_balances(&QueryAllBalancesRequest { address: bob.address(), pagination: None, + resolve_denom: false, }) .unwrap() .balances @@ -577,7 +582,7 @@ mod tests { app.set_param_set( "lockup", - osmosis_std::shim::Any { + cosmrs::Any { type_url: lockup::Params::TYPE_URL.to_string(), value: in_pset.encode_to_vec(), }, diff --git a/packages/test-tube/Cargo.toml b/packages/test-tube/Cargo.toml index 6730bf0..33944fb 100644 --- a/packages/test-tube/Cargo.toml +++ b/packages/test-tube/Cargo.toml @@ -4,25 +4,26 @@ edition = "2021" license = "MIT OR Apache-2.0" name = "test-tube" repository = "https://github.com/osmosis-labs/test-tube" -version = "0.7.0" +version = "0.8.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -base64 = "0.21.5" -cosmrs = { version = "0.15.0", features = ["cosmwasm", "rpc"] } -cosmwasm-std = { version = "1.5.5", features = ["stargate"] } -osmosis-std = { version = "0.25.0", optional = true } -prost = "0.12.3" +base64 = "0.22.1" +cosmrs = {version = "0.20.0", features = ["cosmwasm", "rpc"]} +cosmwasm-std = {version = "2.1", features = ["stargate"]} +osmosis-std = {version = "0.26.0", optional = true} +prost = "0.13.3" serde = "1.0.144" serde_json = "1.0.85" thiserror = "1.0.34" [dev-dependencies] -cw1-whitelist = "1.1.2" +cw1-whitelist = "2.0.0" rayon = "1.5.3" [features] +cosmwasm_2_0 = ["cosmwasm-std/cosmwasm_2_0"] default = [] module-wrappers = ["bank", "wasm"] wasm-sudo = [] diff --git a/packages/test-tube/src/runner/mod.rs b/packages/test-tube/src/runner/mod.rs index 748b1ee..b7ab3de 100644 --- a/packages/test-tube/src/runner/mod.rs +++ b/packages/test-tube/src/runner/mod.rs @@ -56,10 +56,17 @@ pub trait Runner<'a> { .iter() .map(|msg| match msg { CosmosMsg::Bank(msg) => bank_msg_to_any(msg, signer), + + #[allow(deprecated)] CosmosMsg::Stargate { type_url, value } => Ok(cosmrs::Any { type_url: type_url.clone(), value: value.to_vec(), }), + #[cfg(feature = "cosmwasm_2_0")] + CosmosMsg::Any(msg) => Ok(cosmrs::Any { + type_url: msg.type_url.clone(), + value: msg.value.to_vec(), + }), CosmosMsg::Wasm(msg) => wasm_msg_to_any(msg, signer), _ => todo!("unsupported cosmos msg variant"), }) diff --git a/packages/test-tube/src/runner/result.rs b/packages/test-tube/src/runner/result.rs index 4d73236..68853ca 100644 --- a/packages/test-tube/src/runner/result.rs +++ b/packages/test-tube/src/runner/result.rs @@ -53,8 +53,8 @@ where .into_iter() .map(|a| -> Result { Ok(Attribute { - key: std::str::from_utf8(a.key.as_ref())?.to_string(), - value: std::str::from_utf8(a.value.as_ref())?.to_string(), + key: std::str::from_utf8(a.key_bytes())?.to_string(), + value: std::str::from_utf8(a.value_bytes())?.to_string(), }) }) .collect::, Utf8Error>>()?, @@ -103,8 +103,8 @@ where .into_iter() .map(|a| -> Result { Ok(Attribute { - key: a.key.to_string(), - value: a.value.to_string(), + key: std::str::from_utf8(a.key_bytes())?.to_string(), + value: std::str::from_utf8(a.value_bytes())?.to_string(), }) }) .collect::, Utf8Error>>()?, diff --git a/test_contracts/simple-sudo/Cargo.toml b/test_contracts/simple-sudo/Cargo.toml index 76598f1..45e2ee6 100644 --- a/test_contracts/simple-sudo/Cargo.toml +++ b/test_contracts/simple-sudo/Cargo.toml @@ -21,8 +21,6 @@ panic = 'abort' rpath = false [features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] # use library feature to disable all instantiate/execute/query exports library = [] @@ -34,13 +32,13 @@ optimize = """docker run --rm -v "$(pwd)":/code \ """ [dependencies] -cosmwasm-schema = "1.5.0" -cosmwasm-std = {version = "1.5.0"} -cw-storage-plus = "1.1.0" -cw2 = "1.1.1" +cosmwasm-schema = "2.0.0" +cosmwasm-std = {version = "2.0.0"} +cw-storage-plus = "2.0.0" +cw2 = "2.0.0" schemars = "0.8.15" serde = {version = "1.0.189", default-features = false, features = ["derive"]} thiserror = {version = "1.0.49"} [dev-dependencies] -cw-multi-test = "0.17.0" +cw-multi-test = "2.0.0"