public-awesome / cw-nfts

Examples and helpers to build NFT contracts on CosmWasm
Apache License 2.0
185 stars 181 forks source link

Move entry_point flag onto entry functions for cw721-base #74

Closed Callum-A closed 2 years ago

Callum-A commented 2 years ago

Makes the contract multitestable and in line with other contract structures.

0xekez commented 2 years ago

Was writing this up elsewhere, but realize it's only needed here. Reason we need to do this:

Cargo uses feature unification during dependency compilation. During feature unification, cargo determines the union (set theory edition) of all the features set for a given crate and compiles one version of that library with those features enabled. The top level crate or workspace then is linked against this unified library.

From the docs:

A consequence of this is that features should be additive. That is, enabling a feature should not disable functionality.

As it is currently the case the enabling the library feature removes methods this confuses cargo and results in it being impossible to both use cw721 messages in your contract and use it's execute methods in a test.

JakeHartnell commented 2 years ago

Closed with #76