Skip to content

Commit

Permalink
wtf parity
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Nov 27, 2023
1 parent 178b40a commit 2180ad3
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 42 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
ibc-apps-more= { git = "https://github.com/ComposableFi/ibc-rs-apps.git", branch = "main", default-features = false }
6 changes: 3 additions & 3 deletions contracts/cosmwasm/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"] }
ibc-apps-more= { workspace = true, default-features = false, features = ["cosmwasm"] }
8 changes: 4 additions & 4 deletions contracts/cosmwasm/executor/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions contracts/cosmwasm/gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"] }
2 changes: 1 addition & 1 deletion contracts/cosmwasm/gateway/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Auth<policy::WasmHook> {

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!(
Expand Down
2 changes: 1 addition & 1 deletion contracts/cosmwasm/gateway/src/contract/sudo.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions contracts/cosmwasm/order/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions crates/cvm-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ 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 }

[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",
Expand All @@ -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",
]
1 change: 0 additions & 1 deletion crates/cvm-runtime/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub use alloc::{
boxed::Box,
format,
string::{String, ToString},
vec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct MsgSwapExactAmountIn {
#[prost(message, repeated, tag = "2")]
pub routes: Vec<SwapAmountInRoute>,
#[prost(message, optional, tag = "3")]
pub token_in: ::core::option::Option<ibc_apps::cosmos::Coin>,
pub token_in: ::core::option::Option<ibc_apps_more::cosmos::Coin>,
#[prost(string, tag = "4")]
pub token_out_min_amount: String,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cvm-runtime/src/transport/ibc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.

0 comments on commit 2180ad3

Please sign in to comment.