-
Notifications
You must be signed in to change notification settings - Fork 36
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
allow minting directly to nft #178
Conversation
Fixed the last issue, where ALICE mints an NFT with resources to a BOB-owned NFT. The issue is that these resources would all be in a pending state (because BOB is not the rootowner of the collection). Not ideal, the resources should be auto-accepted (after all the NFT itself is already in a pending state, no need to require an accept for every resource in addition to the NFT itself (again only in the case of a |
Fixes #173 |
We should create a separate function for this instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, thank you.
@HashWarlock can you please clarify about separate function. |
We should have a function that mints an NFT to an owner and separate function to mint to an NFT. This keeps from one function doing too much. |
I think I disagree with this making things too complicated, but will trust your judgment. Working on decoupling the enum and implementing fix. |
after a mighty long struggle with decoupling efforts, i've come to agree that decoupling is best. @HashWarlock can you take a peak again when you get a chance? |
fn nft_mint_directly_to_nft( | ||
sender: T::AccountId, | ||
owner: (CollectionId, NftId), | ||
collection_id: CollectionId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't collection_id
redundant now, because it's already part of owner tuple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, owner
is the identifier of the NFT that will own the new NFT, collection_id
is where the NFT should be minted into. I'd expect we don't want to require these collections be the same.
This is basic implementation but some missing pieces
during_mint
parameter toresource_add
, which would override the requirement for sender to equal owner. i'd vote for option 2.