-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(api/nonfungibles): pallet + devnet runtime #339
feat(api/nonfungibles): pallet + devnet runtime #339
Conversation
74ccaa7
to
8832470
Compare
d4c29fe
to
507e7f8
Compare
032bb0c
to
242e53b
Compare
c69dd85
to
b9fe4d8
Compare
}, | ||
/// Details of a specified collection. | ||
#[codec(index = 9)] | ||
Collection(CollectionIdOf<T>), |
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.
[NOT MENTIONED IN THE SPEC]
I added this Collection
read query because I think it is necessary for the smart contract developer to get the details of the NFT collection.
Collection(CollectionIdOf<T>), | ||
/// Next collection ID. | ||
#[codec(index = 10)] | ||
NextCollectionId, |
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.
[NOT MENTIONED IN THE SPEC]
As discussed for the implementation of create
pop-api method, we need this read to query and return from the pop-api contract method.
/// Details of a specified collection. | ||
Collection(Option<CollectionDetailsFor<T>>), | ||
/// Next collection ID. | ||
NextCollectionId(Option<CollectionIdOf<T>>), |
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.
NextCollectionId(Option<CollectionIdOf<T>>), | |
NextCollectionId(CollectionIdOf<T>), |
If we suppose that T::CollectionId::initial_value() == 0
, we could probably return a value instead of Option
from this read.
/// - `approved` - The approval status of the collection item. | ||
#[pallet::call_index(4)] | ||
#[pallet::weight( | ||
NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32) + |
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.
[NOT MENTIONED IN THE SPEC]
The weight for the fn approve()
method depends on branching logic determined by the states of approved
and item
. Refer to the updates in the benchmarking method for fn approve_transfer()
and fn cancel_approval()
to see these adjustments.
) -> DispatchResult { | ||
let creator = ensure_signed(origin.clone())?; | ||
// TODO: re-evaluate next collection id in nfts pallet. The `Incrementable` trait causes | ||
// issues for setting it to xcm's `Location`. This can easily be done differently. |
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.
TODO: re-evaluate next collection id in nfts pallet. The
Incrementable
trait cause issues for setting it to xcm'sLocation
. This can easily be done differently.
Should this TODO be tackled in this PR?
chore: rename nfts instance feat(api/nonfungibles): destroy collection witness data & weights (#383) chore: rename nfts instance fix(api/nonfungibles): pallet weight testing
…onfungibles' into chungquantin/feat-nonfungibles
Description
Implement the runtime pallet
pallet-api/nonfungibles
for the #259. This implementation follows the discussed NFT spec with the forkedpallet-nfts
.Linked PRs
Pallet:
pallet-api/nonfungibles
pallet-api/nonfungibles
.pallet-nfts
andpallet-api/nonfungibles
toTest
runtime inmock.rs
pallet-api/fungibles
to use an updatedAccount
instead ofu8
. (.e.g,account(ALICE)
)pallet-nonfungibles
.devnet
. Merge this PR first: refactor: generic extension #218