CosmWasm / cw-multi-test

CosmWasm multi-contract testing framework
Apache License 2.0
48 stars 42 forks source link

MultiTest features are disabled, but corresponding cosmwasm-std features stay enabled #201

Closed chipshort closed 3 months ago

chipshort commented 4 months ago

cosmwasm-std is specified as a dependency without default-features = false, so pulling in MultiTest enables the default features even if I don't enable the corresponding cw-multi-test feature.

It should instead be specified as cosmwasm-std = { version = "2.0.4", default-features = false } The same problem also happens with cw-storage-plus, since that enables cosmwasm-std/iterator if default features stay enabled.

In general, it's good practice to always use default-features = false for dependencies of a library and enable all needed features manually to minimize enabled features.

This just bit me when implementing something in cw-utils that needs to differentiate between iterator or not-iterator. When I pull in cw-multi-test as dev-dep, iterator is always enabled in tests, but not outside of tests. This makes it impossible for me to control it with my own crate feature in cw-utils.

chipshort commented 3 months ago

Nevermind, looks like the default features are enabled on purpose, so all good.