-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: macro sanity remove importing types #571
Conversation
Okay, so testing depends on the traits moved strictly in the scope of the macro in 404d6ec. This means that we have a few options:
|
From what I've seen, in
Let's just directly reference the whole path then: impl $crate::non_fungible_token::core::NonFungibleTokenCore for $contract { |
Can't do this, because you need the trait in scope to call the inner implementation. If this, then it requires devs to import all NFT traits, which will break all existing uses. This is what I suggested in mitigating with point 2 above. |
ahh I see what you mean. Breaking macro changes are fun aren't they /s. hmm, how about we still go with point 1, but instead also have the macro take multiple (contract, token) pairs so we'd only be able to invoke these macros once per module? That way we force the user to not specify them multiple times |
Closes #570.
This still has the issue that it requires importing the traits in the decl macro, but those are harder to untangle without breaking change (although technically this is a breaking change)Actually,404d6ec
(#571) achieves what I'm thinking of, but not certain this is the cleanest way to keep the macro sanity.