CosmWasm / sylvia

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

Add `BoundQuerier` use to contract macro #205

Closed maurolacy closed 7 months ago

maurolacy commented 1 year ago

Since sylvia 0.5.0 it's necessary to add

use crate::contract::BoundQuerier;

before using the #[contract] macro.

Either document this, or include the use directive directly in the macro (or directly qualify the BoundQuerier usage).

hashedone commented 1 year ago

@jawoznia we should address it

jawoznia commented 1 year ago

The issue appears when implementing interface on contract. Currently if impl Interface for Contract is in different module than Contract itself you need to provide path to the contract file via f.e. #[contract(module=crate::contract). It is described in Macro attributes section in README.

I will add info in the troubleshooting section and think about better explanation in whole README

hashedone commented 1 year ago

Most probably we should add am ~warning~ error if module= is not there, as it would be needed in 99% of cases. The additional module=self syntax should be introduced to point to the "local" module and silence a warning if it is intended.

hashedone commented 7 months ago

Dupe of #164