From 2180ad32a36b0f2a83fe530bc84d685510271c3e Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Mon, 27 Nov 2023 21:11:07 +0000 Subject: [PATCH] wtf parity --- Cargo.lock | 36 +++++++++---------- Cargo.toml | 2 +- contracts/cosmwasm/executor/Cargo.toml | 6 ++-- contracts/cosmwasm/executor/src/contract.rs | 8 ++--- contracts/cosmwasm/gateway/Cargo.toml | 6 ++-- contracts/cosmwasm/gateway/src/auth.rs | 2 +- .../cosmwasm/gateway/src/contract/sudo.rs | 2 +- contracts/cosmwasm/order/Cargo.toml | 6 ++-- crates/cvm-runtime/Cargo.toml | 8 ++--- crates/cvm-runtime/src/prelude.rs | 1 - .../types/osmosis/poolmanager/v1beta1.rs | 2 +- crates/cvm-runtime/src/transport/ibc/mod.rs | 2 +- flake.nix | 2 +- flake-module.nix => flake/flake-module.nix | 0 14 files changed, 41 insertions(+), 42 deletions(-) rename flake-module.nix => flake/flake-module.nix (100%) diff --git a/Cargo.lock b/Cargo.lock index 26a308f9..72a4326a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,9 +500,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "clap" -version = "4.4.8" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "46ca43acc1b21c6cc2d1d3129c19e323a613935b5bc28fb3b33b5b2e5fb00030" dependencies = [ "clap_builder", "clap_derive", @@ -510,9 +510,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" dependencies = [ "anstream", "anstyle", @@ -784,7 +784,7 @@ dependencies = [ "derive_more", "hex", "ibc", - "ibc-apps 0.1.0", + "ibc-apps-more", "ibc-proto 0.39.1", "num", "parity-scale-codec", @@ -874,7 +874,7 @@ dependencies = [ "cw2", "cw20", "hex", - "ibc-apps 0.1.0", + "ibc-apps-more", "num", "prost", "schemars", @@ -898,7 +898,7 @@ dependencies = [ "cw20", "enumn", "ibc", - "ibc-apps 0.1.0", + "ibc-apps-more", "prost", "schemars", "serde", @@ -1554,7 +1554,7 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "429b6aca6624a9364878e28c90311438c2621a8270942d80732b2651ac38ac74" dependencies = [ - "ibc-apps 0.48.1", + "ibc-apps", "ibc-clients", "ibc-core", "ibc-core-host-cosmos", @@ -1593,8 +1593,17 @@ dependencies = [ [[package]] name = "ibc-apps" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4be40d55ed2dea9f2d05b902a3586f20850c723e4bdbfc4fb0ebe7a66ca5e40" +dependencies = [ + "ibc-app-transfer", +] + +[[package]] +name = "ibc-apps-more" version = "0.1.0" -source = "git+https://github.com/ComposableFi/ibc-rs-apps.git?branch=main#7c1f4ea26705c7028348d90a62ae77e186bc4b5a" +source = "git+https://github.com/ComposableFi/ibc-rs-apps.git?branch=main#557eb5498815c406339e42764bea7333106ad254" dependencies = [ "bech32", "cosmwasm-std", @@ -1608,15 +1617,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "ibc-apps" -version = "0.48.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4be40d55ed2dea9f2d05b902a3586f20850c723e4bdbfc4fb0ebe7a66ca5e40" -dependencies = [ - "ibc-app-transfer", -] - [[package]] name = "ibc-client-tendermint" version = "0.48.1" diff --git a/Cargo.toml b/Cargo.toml index c3ea53bd..23edd3b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,4 +90,4 @@ thiserror = { version = "^1.0.50", default-features = false, package = "thiserro xcm = { version = "^5.0.0", default-features = false, package = "staging-xcm" } cw-utils = { version = "^1.0.3", default-features = false } cw2 = { version = "^1.1.2", default-features = false } -ibc-apps = { git = "https://github.com/ComposableFi/ibc-rs-apps.git", branch = "main", default-features = false } \ No newline at end of file +ibc-apps-more= { git = "https://github.com/ComposableFi/ibc-rs-apps.git", branch = "main", default-features = false } \ No newline at end of file diff --git a/contracts/cosmwasm/executor/Cargo.toml b/contracts/cosmwasm/executor/Cargo.toml index b7a338b8..d8bd64d0 100644 --- a/contracts/cosmwasm/executor/Cargo.toml +++ b/contracts/cosmwasm/executor/Cargo.toml @@ -10,8 +10,8 @@ crate-type = ["cdylib", "rlib"] [features] library = [] -json-shema = ["ibc-apps/json-schema"] -std = ["cvm-runtime/std", "dep:cosmwasm-schema", "ibc-apps/std"] +json-shema = ["ibc-apps-more/json-schema"] +std = ["cvm-runtime/std", "dep:cosmwasm-schema", "ibc-apps-more/std"] default = ["std"] [dependencies] @@ -32,4 +32,4 @@ prost = { workspace = true, features = ["prost-derive"] } cvm-runtime = { path = "../../../crates/cvm-runtime", features = [ "cosmwasm", ], default-features = false } -ibc-apps = { workspace = true, default-features = false, features = ["cosmwasm"] } \ No newline at end of file +ibc-apps-more= { workspace = true, default-features = false, features = ["cosmwasm"] } \ No newline at end of file diff --git a/contracts/cosmwasm/executor/src/contract.rs b/contracts/cosmwasm/executor/src/contract.rs index f23fbf40..1460b82a 100644 --- a/contracts/cosmwasm/executor/src/contract.rs +++ b/contracts/cosmwasm/executor/src/contract.rs @@ -196,8 +196,8 @@ fn interpret_exchange( let amount: Coin = deps.querier.query_balance(&sender, asset.denom())?; let amount = give.1.apply(amount.amount.u128())?; - let give: ibc_apps::cosmos::Coin = - ibc_apps::cosmos::Coin { denom: asset.denom(), amount: amount.to_string() }; + let give: ibc_apps_more::cosmos::Coin = + ibc_apps_more::cosmos::Coin { denom: asset.denom(), amount: amount.to_string() }; let asset = gateway_address .get_asset_by_id(deps.querier, want.0) @@ -208,10 +208,10 @@ fn interpret_exchange( } let want = if want.1.is_absolute() { - ibc_apps::cosmos::Coin { denom: asset.denom(), amount: want.1.intercept.to_string() } + ibc_apps_more::cosmos::Coin { denom: asset.denom(), amount: want.1.intercept.to_string() } } else { // use https://github.com/osmosis-labs/osmosis/blob/main/cosmwasm/contracts/swaprouter/src/msg.rs to allow slippage - ibc_apps::cosmos::Coin { denom: asset.denom(), amount: "1".to_string() } + ibc_apps_more::cosmos::Coin { denom: asset.denom(), amount: "1".to_string() } }; let response = match exchange.exchange { diff --git a/contracts/cosmwasm/gateway/Cargo.toml b/contracts/cosmwasm/gateway/Cargo.toml index e74cb31e..402705b9 100644 --- a/contracts/cosmwasm/gateway/Cargo.toml +++ b/contracts/cosmwasm/gateway/Cargo.toml @@ -13,8 +13,8 @@ workspace = true [features] library = [] -std = ["cw-xc-executor/std", "cvm-runtime/std", "ibc-apps/std"] -json-schema = ["ibc-apps/json-schema"] +std = ["cw-xc-executor/std", "cvm-runtime/std", "ibc-apps-more/std"] +json-schema = ["ibc-apps-more/json-schema"] default = ["std"] [dependencies] @@ -39,4 +39,4 @@ cvm-runtime = { path = "../../../crates/cvm-runtime", features = [ "cosmwasm", ], default-features = false } prost = { workspace = true, default-features = false } -ibc-apps = { workspace = true, default-features = false, features = ["cosmwasm"] } +ibc-apps-more= { workspace = true, default-features = false, features = ["cosmwasm"] } diff --git a/contracts/cosmwasm/gateway/src/auth.rs b/contracts/cosmwasm/gateway/src/auth.rs index 2cc0c43d..ea671da4 100644 --- a/contracts/cosmwasm/gateway/src/auth.rs +++ b/contracts/cosmwasm/gateway/src/auth.rs @@ -74,7 +74,7 @@ impl Auth { let channel = this_to_other.ics_20.ok_or(ContractError::ICS20NotFound)?.source; let hash_of_channel_and_sender = - ibc_apps::hook::derive_intermediate_sender( + ibc_apps_more::hook::derive_intermediate_sender( &channel, &sender, &prefix, )?; deps.api.debug(&format!( diff --git a/contracts/cosmwasm/gateway/src/contract/sudo.rs b/contracts/cosmwasm/gateway/src/contract/sudo.rs index c1e9e3fd..745a2762 100644 --- a/contracts/cosmwasm/gateway/src/contract/sudo.rs +++ b/contracts/cosmwasm/gateway/src/contract/sudo.rs @@ -1,7 +1,7 @@ use crate::{error::ContractError, state}; use cosmwasm_std::{entry_point, wasm_execute, Coin, DepsMut, Env, Event, Response}; use ibc::core::host::types::identifiers::ChannelId; -use ibc_apps::hook::{IBCLifecycleComplete, SudoMsg}; +use ibc_apps_more::hook::{IBCLifecycleComplete, SudoMsg}; #[cfg_attr(not(feature = "library"), entry_point)] pub fn sudo(deps: DepsMut, env: Env, msg: SudoMsg) -> crate::error::Result { diff --git a/contracts/cosmwasm/order/Cargo.toml b/contracts/cosmwasm/order/Cargo.toml index 16bfcf20..90199e83 100644 --- a/contracts/cosmwasm/order/Cargo.toml +++ b/contracts/cosmwasm/order/Cargo.toml @@ -29,13 +29,15 @@ num-integer = { workspace = true, default-features = false, features = [ cvm-runtime = { path = "../../../crates/cvm-runtime", default-features = false, features = [ "std", "cosmwasm", - "std", - "json-schema", ] } no-panic = {workspace = true} tuples ={ workspace = true } +[features] +std = ["cvm-runtime/std"] +json-schema = ["cvm-runtime/json-schema"] + [dev-dependencies] num-rational = { workspace = true, default-features = false, features = [ "num-bigint-std", diff --git a/crates/cvm-runtime/Cargo.toml b/crates/cvm-runtime/Cargo.toml index 0ac66097..a067d481 100644 --- a/crates/cvm-runtime/Cargo.toml +++ b/crates/cvm-runtime/Cargo.toml @@ -35,7 +35,7 @@ primitive-types = { version = "^0.12.2", features = [ "serde_no_std", ], default-features = false } -ibc-apps = { workspace = true, default-features = false } +ibc-apps-more= { workspace = true, default-features = false } [build-dependencies] prost-build = { workspace = true } @@ -43,11 +43,11 @@ prost-build = { workspace = true } [features] default = ["std"] xcm = ["dep:xcm"] -cosmwasm = ["cw-storage-plus", "cw20", "ibc-apps/cosmwasm"] +cosmwasm = ["cw-storage-plus", "cw20", "ibc-apps-more/cosmwasm"] substrate = ["xcm"] json-schema = [ "serde-cw-value/schema", - "ibc-apps/json-schema", + "ibc-apps-more/json-schema", "dep:cosmwasm-schema", "dep:schemars", "ibc/schema", @@ -57,9 +57,7 @@ json-schema = [ std = [ "ibc-proto/std", - "ibc/std", "serde-cw-value/std", "serde-json-wasm/std", "num/std", - "primitive-types/std", ] diff --git a/crates/cvm-runtime/src/prelude.rs b/crates/cvm-runtime/src/prelude.rs index 538704a4..a9479d79 100644 --- a/crates/cvm-runtime/src/prelude.rs +++ b/crates/cvm-runtime/src/prelude.rs @@ -1,5 +1,4 @@ pub use alloc::{ - boxed::Box, format, string::{String, ToString}, vec, diff --git a/crates/cvm-runtime/src/service/dex/osmosis_std/types/osmosis/poolmanager/v1beta1.rs b/crates/cvm-runtime/src/service/dex/osmosis_std/types/osmosis/poolmanager/v1beta1.rs index c471176c..c3740e0e 100644 --- a/crates/cvm-runtime/src/service/dex/osmosis_std/types/osmosis/poolmanager/v1beta1.rs +++ b/crates/cvm-runtime/src/service/dex/osmosis_std/types/osmosis/poolmanager/v1beta1.rs @@ -9,7 +9,7 @@ pub struct MsgSwapExactAmountIn { #[prost(message, repeated, tag = "2")] pub routes: Vec, #[prost(message, optional, tag = "3")] - pub token_in: ::core::option::Option, + pub token_in: ::core::option::Option, #[prost(string, tag = "4")] pub token_out_min_amount: String, } diff --git a/crates/cvm-runtime/src/transport/ibc/mod.rs b/crates/cvm-runtime/src/transport/ibc/mod.rs index 8b80a5ca..1f019c18 100644 --- a/crates/cvm-runtime/src/transport/ibc/mod.rs +++ b/crates/cvm-runtime/src/transport/ibc/mod.rs @@ -8,7 +8,7 @@ use cosmwasm_std::{Api, BlockInfo, CosmosMsg, Deps, IbcEndpoint, StdResult}; use ibc::core::host::types::identifiers::{ChannelId, ConnectionId, PortId}; -use ibc_apps::{ +use ibc_apps_more::{ hook::{Callback, SendMemo}, memo::Memo, }; diff --git a/flake.nix b/flake.nix index a7006247..ebed8abb 100644 --- a/flake.nix +++ b/flake.nix @@ -76,7 +76,7 @@ ''; }; - cw-mantis-order = makeCosmwasmContract "cw-mantis-order" rust "--no-default-features"; + cw-mantis-order = makeCosmwasmContract "cw-mantis-order" rust "--no-default-features --features=std"; in { _module.args.pkgs = import self.inputs.nixpkgs { inherit system; diff --git a/flake-module.nix b/flake/flake-module.nix similarity index 100% rename from flake-module.nix rename to flake/flake-module.nix