Skip to content

Commit

Permalink
Merge pull request #258 from CosmWasm/more-multitest-improvements
Browse files Browse the repository at this point in the history
More multitest improvements
  • Loading branch information
ethanfrey authored Apr 1, 2021
2 parents 24a2093 + c8a522a commit 6dff2bb
Show file tree
Hide file tree
Showing 9 changed files with 383 additions and 131 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions contracts/cw20-escrow/src/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(test)]

use cosmwasm_std::testing::{mock_env, MockApi, MockStorage};
use cosmwasm_std::{coins, to_binary, HumanAddr, Uint128};
use cosmwasm_std::{coins, to_binary, Empty, HumanAddr, Uint128};
use cw20::{Cw20CoinHuman, Cw20Contract, Cw20ExecuteMsg};
use cw_multi_test::{App, Contract, ContractWrapper, SimpleBank};

Expand All @@ -15,7 +15,7 @@ fn mock_app() -> App {
App::new(api, env.block, bank, || Box::new(MockStorage::new()))
}

pub fn contract_escrow() -> Box<dyn Contract> {
pub fn contract_escrow() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
crate::contract::execute,
crate::contract::instantiate,
Expand All @@ -24,7 +24,7 @@ pub fn contract_escrow() -> Box<dyn Contract> {
Box::new(contract)
}

pub fn contract_cw20() -> Box<dyn Contract> {
pub fn contract_cw20() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cw20_base::contract::execute,
cw20_base::contract::instantiate,
Expand Down
2 changes: 0 additions & 2 deletions contracts/cw20-ics20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.14.0-alpha2" }
cw-multi-test = { path = "../../packages/multi-test", version = "0.6.0-alpha2" }
cw20-base = { path = "../cw20-base", version = "0.6.0-alpha2", features = ["library"] }
6 changes: 3 additions & 3 deletions contracts/cw3-fixed-multisig/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::contract::{execute, instantiate, query};
use crate::msg::{ExecuteMsg, InstantiateMsg, Voter};
use cosmwasm_std::testing::{mock_env, MockApi, MockStorage};
use cosmwasm_std::{from_binary, to_binary, HumanAddr, Uint128, WasmMsg, WasmQuery};
use cosmwasm_std::{from_binary, to_binary, Empty, HumanAddr, Uint128, WasmMsg, WasmQuery};
use cw0::Duration;
use cw20::{BalanceResponse, MinterResponse};
use cw20_base::msg::QueryMsg;
Expand All @@ -18,12 +18,12 @@ fn mock_app() -> App {
App::new(api, env.block, bank, || Box::new(MockStorage::new()))
}

pub fn contract_cw3_fixed_multisig() -> Box<dyn Contract> {
pub fn contract_cw3_fixed_multisig() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(execute, instantiate, query);
Box::new(contract)
}

pub fn contract_cw20() -> Box<dyn Contract> {
pub fn contract_cw20() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cw20_base::contract::execute,
cw20_base::contract::instantiate,
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw3-flex-multisig/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ mod tests {
}
}

pub fn contract_flex() -> Box<dyn Contract> {
pub fn contract_flex() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
crate::contract::execute,
crate::contract::instantiate,
Expand All @@ -489,7 +489,7 @@ mod tests {
Box::new(contract)
}

pub fn contract_group() -> Box<dyn Contract> {
pub fn contract_group() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cw4_group::contract::execute,
cw4_group::contract::instantiate,
Expand Down
2 changes: 2 additions & 0 deletions packages/multi-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ documentation = "https://docs.cosmwasm.com"
[features]
default = ["iterator"]
iterator = ["cosmwasm-std/iterator"]
stargate = ["cosmwasm-std/stargate"]

[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.6.0-alpha2" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.6.0-alpha2" }
cosmwasm-std = { version = "0.14.0-beta1" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Loading

0 comments on commit 6dff2bb

Please sign in to comment.