Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[PLAT-763], [PLAT-764] Refactor NFT ownership with immutable attributes #246

Merged
merged 12 commits into from
Mar 30, 2023

Conversation

cowboy-bebug
Copy link
Contributor

@cowboy-bebug cowboy-bebug commented Mar 28, 2023

Description

Re: PLAT-763 & PLAT-764

Main changes:

  • update the ownership of an avatar like below:
    • player owns avatar initially, and on store_as_nft:
      • pallet account owns the avatar in pallet-ajuna-awesome-avatars
      • player owns the NFT of the avatar in pallet-nfts
        • at a later offloading stage, the ownership will be transferred to pallet-ajuna-nft-transfer's pallet account
  • disable PalletFeature::Attributes to prevent attribute mutation through the pallet-nfts extrinsics
  • Remove NextItemId and use AvatarId (H256) as the ItemId
    • (to ensure unique avatars are stored under a collection)

Type of changes

  • build: Changes that affect the build system or external dependencies (eg, Cargo, Docker)
  • ci: Changes to CI configuration
  • docs: Changes to documentation only
  • feat: Changes to add a new feature
  • fix: Changes to fix a bug
  • refactor: Changes that do not alter functionality
  • style: Changes to format the code
  • test: Changes to add missing tests or correct existing tests

Checklist

  • Tests for the changes have been added
  • Necessary documentation is added (if appropriate)
  • Formatted with cargo fmt --all
  • Linted with cargo clippy --all-features --all-targets
  • Tested with cargo test --workspace --all-features --all-targets

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Patch coverage: 75.86% and project coverage change: -0.15 ⚠️

Comparison is base (6f5dcbd) 77.70% compared to head (381db68) 77.56%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #246      +/-   ##
===========================================
- Coverage    77.70%   77.56%   -0.15%     
===========================================
  Files           17       17              
  Lines         1144     1141       -3     
===========================================
- Hits           889      885       -4     
- Misses         255      256       +1     
Impacted Files Coverage Δ
pallets/ajuna-awesome-avatars/src/migration/v4.rs 0.00% <0.00%> (ø)
pallets/ajuna-nft-transfer/src/traits.rs 100.00% <ø> (ø)
pallets/ajuna-nft-transfer/src/lib.rs 72.34% <78.57%> (+2.98%) ⬆️
pallets/ajuna-awesome-avatars/src/lib.rs 89.04% <100.00%> (+0.29%) ⬆️
...lets/ajuna-awesome-avatars/src/types/avatar/nft.rs 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cowboy-bebug cowboy-bebug force-pushed the el/PLAT-763-nft-ownership-transfer branch from b2992aa to d4a7a69 Compare March 28, 2023 20:34
@cowboy-bebug cowboy-bebug force-pushed the el/PLAT-763-nft-ownership-transfer branch from e4f142b to 1c8fd6e Compare March 30, 2023 03:23
@cowboy-bebug cowboy-bebug changed the title [PLAT-763] Refactor NFT transfer ownership [PLAT-763], [PLAT-764] Refactor NFT ownership with immutable attributes Mar 30, 2023
* rename all asset -> item
* remove nft-staking integration for now
* tidy ups
@cowboy-bebug cowboy-bebug force-pushed the el/PLAT-763-nft-ownership-transfer branch from 1c8fd6e to ed94c47 Compare March 30, 2023 04:30
@cowboy-bebug cowboy-bebug marked this pull request as ready for review March 30, 2023 18:57
@cowboy-bebug cowboy-bebug merged commit 8a3383b into develop Mar 30, 2023
@cowboy-bebug cowboy-bebug deleted the el/PLAT-763-nft-ownership-transfer branch March 30, 2023 18:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant