Skip to content

Commit

Permalink
fix: Enable cw-multi-test features only if it is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Dec 18, 2023
1 parent b3cc2c5 commit 6886d9b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 30 deletions.
4 changes: 2 additions & 2 deletions 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 examples/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 examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ edition = "2021"
anyhow = "1.0.75"
cosmwasm-schema = "1.5.0"
cosmwasm-std = "1.5.0"
cw-multi-test = "0.19.0"
cw-multi-test = "0.20.0"
cw-storage-plus = "1.2.0"
cw-utils = "1.0.2"
cw2 = "1.1.2"
Expand Down
23 changes: 5 additions & 18 deletions sylvia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,15 @@ categories = ["api-bindings", "wasm"]
mt = ["sylvia-derive/mt", "dep:cw-multi-test", "dep:anyhow", "dep:derivative"]
stargate = ["cosmwasm-std/stargate"]
iterator = ["cosmwasm-std/iterator"]
cosmwasm_1_1 = [
"dep:cw-multi-test",
"cosmwasm-std/cosmwasm_1_1",
"cw-multi-test?/cosmwasm_1_1",
]
cosmwasm_1_1 = ["cosmwasm-std/cosmwasm_1_1", "cw-multi-test?/cosmwasm_1_1"]
cosmwasm_1_2 = [
"dep:cw-multi-test",
"cosmwasm-std/cosmwasm_1_2",
"cw-multi-test?/cosmwasm_1_2",
"dep:cw-utils",
"sylvia-derive/cosmwasm_1_2",
]
cosmwasm_1_3 = [
"dep:cw-multi-test",
"cosmwasm-std/cosmwasm_1_3",
"cw-multi-test?/cosmwasm_1_3",
]
cosmwasm_1_4 = [
"dep:cw-multi-test",
"cosmwasm-std/cosmwasm_1_4",
"cw-multi-test?/cosmwasm_1_4",
]
cosmwasm_1_3 = ["cosmwasm-std/cosmwasm_1_3", "cw-multi-test?/cosmwasm_1_3"]
cosmwasm_1_4 = ["cosmwasm-std/cosmwasm_1_4", "cw-multi-test?/cosmwasm_1_4"]

[dependencies]
sylvia-derive = { workspace = true }
Expand All @@ -46,14 +33,14 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
serde-cw-value = "0.7.0"
serde-json-wasm = "1.0.0"
konst = "0.3"
cw-multi-test = { version = "0.19.0", optional = true }
cw-multi-test = { version = "0.20.0", optional = true }
anyhow = { version = "1.0", optional = true }
derivative = { version = "2.2.0", optional = true }
cw-utils = { version = "1.0.2", optional = true }

[dev-dependencies]
anyhow = "1.0"
cw-multi-test = "0.19.0"
cw-multi-test = "0.20.0"
cw-storage-plus = "1.2.0"
cw-utils = "1.0.2"
thiserror = "1.0.50"
14 changes: 7 additions & 7 deletions sylvia/src/multitest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use std::cell::{Ref, RefCell, RefMut};
use std::fmt::{Debug, Display};
use std::marker::PhantomData;

use cosmwasm_std::{
Addr, Api, BlockInfo, Coin, CustomQuery, Empty, GovMsg, IbcMsg, IbcQuery, Storage,
};
use cosmwasm_std::{Addr, Api, BlockInfo, Coin, CustomQuery, Empty, Storage};
#[cfg(feature = "cosmwasm_1_2")]
use cosmwasm_std::{CodeInfoResponse, StdResult};
use cw_multi_test::{
Bank, BankKeeper, Distribution, DistributionKeeper, Executor, FailingModule, Gov, Ibc, Module,
Router, StakeKeeper, Staking, Wasm, WasmKeeper,
Bank, BankKeeper, Distribution, DistributionKeeper, Executor, FailingModule, Gov,
GovFailingModule, Ibc, IbcFailingModule, Module, Router, StakeKeeper, Staking, StargateFailing,
Wasm, WasmKeeper,
};
use schemars::JsonSchema;
use serde::de::DeserializeOwned;
Expand Down Expand Up @@ -41,8 +40,9 @@ impl<ExecC, QueryC> App<cw_multi_test::BasicApp<ExecC, QueryC>> {
WasmKeeper<ExecC, QueryC>,
StakeKeeper,
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
IbcFailingModule,
GovFailingModule,
StargateFailing,
>,
&dyn Api,
&mut dyn Storage,
Expand Down

0 comments on commit 6886d9b

Please sign in to comment.