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(nfts): add nonfungibles runtime implementation #339

Open
wants to merge 18 commits into
base: chungquantin/chore-pallet_nfts
Choose a base branch
from

Conversation

chungquantin
Copy link
Collaborator

@chungquantin chungquantin commented Oct 14, 2024

Description

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

pallet-nfts

  • [pallet-nfts] Adding two storage items.
    • AccountBalance: Keep track of the total number of collection items an account has.
    • Allowances: Keep track of the collection approval status for a delegated account.
  • [pallet-nfts] [AccountBalance] Update existing methods' logic
    • do_transfer: Increase account balance of sender and decrease account balance of dest on transferred.
    • do_mint: Increase account balance of minter on minted.
    • do_burn: Decrease account balance of owner on burnt.
  • [pallet-nfts] [Allowances] Update existing methods' logic
  • [pallet-nfts] Update existing events' structure.
  • [pallet-nfts] Rerun benchmarking

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.
  • Add non-fungibles feature to devnet. Merge this PR first: refactor: generic extension #218
  • Integration unit testing non-fungibles API.

@chungquantin chungquantin changed the title feat: add nonfungibles pallet implementation feat(devnet): add nonfungibles pallet implementation Oct 14, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 93.58025% with 26 lines in your changes missing coverage. Please review.

Project coverage is 53.85%. Comparing base (52fb7f0) to head (184ae45).

Files with missing lines Patch % Lines
pallets/api/src/nonfungibles/mod.rs 67.56% 14 Missing and 10 partials ⚠️
pallets/api/src/nonfungibles/types.rs 0.00% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   51.60%   53.85%   +2.24%     
==========================================
  Files          48       51       +3     
  Lines        4910     5205     +295     
  Branches     4910     5205     +295     
==========================================
+ Hits         2534     2803     +269     
- Misses       2327     2343      +16     
- Partials       49       59      +10     
Files with missing lines Coverage Δ
pallets/api/src/fungibles/tests.rs 99.72% <100.00%> (+0.02%) ⬆️
pallets/api/src/mock.rs 100.00% <100.00%> (ø)
pallets/api/src/nonfungibles/tests.rs 100.00% <100.00%> (ø)
pallets/api/src/nonfungibles/types.rs 0.00% <0.00%> (ø)
pallets/api/src/nonfungibles/mod.rs 67.56% <67.56%> (ø)

@chungquantin chungquantin changed the base branch from main to chungquantin/chore-pallet_nfts October 14, 2024 15:25
@chungquantin chungquantin changed the title feat(devnet): add nonfungibles pallet implementation feat(devnet): add nonfungibles runtime implementation Oct 17, 2024
@chungquantin chungquantin changed the title feat(devnet): add nonfungibles runtime implementation feat(nfts): add nonfungibles runtime implementation Oct 17, 2024
@chungquantin chungquantin self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants