CosmWasm / sylvia

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

Proposal: Introduce new proc-macro for Interface implementation on Contract #313

Closed kulikthebird closed 5 months ago

kulikthebird commented 5 months ago

Since #[contract] without a module is intended only for impl Contract {...}, and #[contract(module=...)] is for impl Interface for Contract {...}. In reallity, these should be two separate macros, since they are responsible for different things. Cost of that change is negligible and it will increase the "understandability" of the code for the user.

Initial proposal:

#[interface_impl(contract_module=...)]
impl Interface for Contract {
    // [...]
}
kulikthebird commented 5 months ago

This issue will be covered by https://github.com/CosmWasm/sylvia/pull/315. The mentioned PR removes the requirement for specifying #[contract(module=...)] for interface implementation on a contract.