CosmWasm / sylvia

CosmWasm smart contract framework
Apache License 2.0
93 stars 14 forks source link

Unable to compile to target wasm in v0.9.2 with cw-multi-test v0.19.0 #277

Closed whalelephant closed 8 months ago

whalelephant commented 9 months ago

I am using sylvia v0.9.2 which has a dependency on cw-multi-test v0.19.0.

When trying to build the contracts with a wasm as target (using rust-optimizer), the following error occurs:

error[E0432]: unresolved import `cosmwasm_std::testing`
 --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cw-multi-test-0.19.0/src/addons/api/bech32.rs:2:19
  |
2 | use cosmwasm_std::testing::MockApi;
  |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

error[E0432]: unresolved import `cosmwasm_std::testing`
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cw-multi-test-0.19.0/src/app.rs:12:19
   |
12 | use cosmwasm_std::testing::{MockApi, MockStorage};
   |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

error[E0432]: unresolved import `cosmwasm_std::testing`
 --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cw-multi-test-0.19.0/src/app_builder.rs:7:19
  |
7 | use cosmwasm_std::testing::{mock_env, MockApi, MockStorage};
  |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

error[E0432]: unresolved import `cosmwasm_std::testing`
 --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cw-multi-test-0.19.0/src/wasm.rs:9:19
  |
9 | use cosmwasm_std::testing::mock_wasmd_attr;
  |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

As a result, I am unable to build the contracts. Perhaps we can only have cw-multi-test as dependency on dev / test.

jawoznia commented 8 months ago

Hi @whalelephant please upgrade to sylvia 0.9.3. cw-multi-test was unnecessarily enabled when cosmwasm_1_x features were enabled and is not anymore.