Skip to content
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(nonfungibles): add pallet-api/nonfungibles #388

Open
wants to merge 1 commit into
base: chungquantin/feat-nfts
Choose a base branch
from

Conversation

chungquantin
Copy link
Collaborator

Description

Implement the runtime pallet pallet-api/nonfungibles for the #259. This implementation follows the discussed NFT spec with the forked pallet-nfts.

Linked PRs

Pallet: pallet-api/nonfungibles

  • Implement basic functionalities of the pallet-api/nonfungibles.
  • Configure pallet-nfts and pallet-api/nonfungibles to Test runtime in mock.rs
    • refactor: pallet tests of pallet-api/fungibles to use an updated Account instead of u8. (.e.g, account(ALICE))
  • pallet unit testing with pallet-nonfungibles.

@chungquantin chungquantin changed the title feat(api/nonfungibles): add pallet-api/nonfungibles feat(nonfungibles): add pallet-api/nonfungibles Nov 19, 2024
@chungquantin chungquantin self-assigned this Nov 19, 2024
@chungquantin chungquantin linked an issue Nov 19, 2024 that may be closed by this pull request
5 tasks
/// The namespace of the attribute.
namespace: AttributeNamespaceOf<T>,
/// The key of the attribute.
key: BoundedVec<u8, T::KeyLimit>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this parameter be changed to Vec and we handle the length check in the runtime, so contract api implementation does not need to handle it?

config: CollectionConfigFor<T>,
) -> DispatchResult {
let creator = ensure_signed(origin.clone())?;
// TODO: re-evaluate next collection id in nfts pallet. The `Incrementable` trait causes
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this TODO be tackled in this PR?

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.31058% with 137 lines in your changes missing coverage. Please review.

Project coverage is 71.42%. Comparing base (9d1658e) to head (841035a).

Files with missing lines Patch % Lines
pallets/api/src/nonfungibles/weights.rs 50.00% 64 Missing ⚠️
pallets/api/src/nonfungibles/mod.rs 72.72% 32 Missing and 13 partials ⚠️
pallets/api/src/mock.rs 8.69% 21 Missing ⚠️
pallets/api/src/nonfungibles/benchmarking.rs 0.00% 5 Missing ⚠️
pallets/api/src/nonfungibles/tests.rs 99.76% 1 Missing and 1 partial ⚠️
@@                    Coverage Diff                     @@
##           chungquantin/feat-nfts     #388      +/-   ##
==========================================================
+ Coverage                   69.57%   71.42%   +1.84%     
==========================================================
  Files                          69       73       +4     
  Lines                       12222    13394    +1172     
  Branches                    12222    13394    +1172     
==========================================================
+ Hits                         8504     9566    +1062     
- Misses                       3448     3545      +97     
- Partials                      270      283      +13     
Files with missing lines Coverage Δ
pallets/api/src/nonfungibles/tests.rs 99.76% <99.76%> (ø)
pallets/api/src/nonfungibles/benchmarking.rs 0.00% <0.00%> (ø)
pallets/api/src/mock.rs 55.31% <8.69%> (-44.69%) ⬇️
pallets/api/src/nonfungibles/mod.rs 72.72% <72.72%> (ø)
pallets/api/src/nonfungibles/weights.rs 50.00% <50.00%> (ø)

... and 3 files with indirect coverage changes


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(devnet): non-fungibles use case
2 participants