Skip to content

feat(nfts + nonfungibles): sync polkadot stable2503 #558

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

Open
wants to merge 18 commits into
base: al3mart/sync-polkadot-stable2503
Choose a base branch
from

Conversation

chungquantin
Copy link
Collaborator

@chungquantin chungquantin commented May 5, 2025

This PR syncs all changes from v1.15.0 to polkadot-stable2503 for the pallet-nfts and pallet-nonfugibles

Requires rebasing to this commit on main.

Related upstream commits:

Commit comments are identical to the commits in pallet-nfts | stable2503

@chungquantin chungquantin self-assigned this May 5, 2025
@chungquantin
Copy link
Collaborator Author

[sc-3710]

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2025

Codecov Report

Attention: Patch coverage is 14.86486% with 189 lines in your changes missing coverage. Please review.

Project coverage is 63.98%. Comparing base (6cb9ad9) to head (cdb2a1c).

Files with missing lines Patch % Lines
pallets/nfts/src/weights.rs 7.89% 175 Missing ⚠️
pallets/nfts/src/types.rs 0.00% 12 Missing ⚠️
pallets/nfts/src/migration.rs 0.00% 1 Missing ⚠️
pallets/nfts/src/tests.rs 0.00% 1 Missing ⚠️
@@                         Coverage Diff                          @@
##           al3mart/sync-polkadot-stable2503     #558      +/-   ##
====================================================================
+ Coverage                             63.88%   63.98%   +0.09%     
====================================================================
  Files                                   120      120              
  Lines                                 23686    23640      -46     
  Branches                              23686    23640      -46     
====================================================================
- Hits                                  15132    15125       -7     
+ Misses                                 7514     7475      -39     
  Partials                               1040     1040              
Files with missing lines Coverage Δ
pallets/api/src/mock.rs 74.46% <ø> (ø)
pallets/api/src/nonfungibles/mod.rs 95.80% <ø> (ø)
pallets/api/src/nonfungibles/weights.rs 50.00% <ø> (ø)
pallets/nfts/src/features/approvals.rs 97.11% <100.00%> (ø)
pallets/nfts/src/features/atomic_swap.rs 90.84% <100.00%> (+0.06%) ⬆️
pallets/nfts/src/features/attributes.rs 86.97% <100.00%> (ø)
pallets/nfts/src/features/create_delete_item.rs 88.46% <100.00%> (ø)
pallets/nfts/src/features/settings.rs 87.67% <100.00%> (-0.65%) ⬇️
pallets/nfts/src/lib.rs 69.69% <100.00%> (ø)
pallets/nfts/src/mock.rs 93.75% <ø> (ø)
... and 5 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@al3mart al3mart force-pushed the al3mart/sync-polkadot-stable2503 branch from 06f0e43 to 6cb9ad9 Compare May 5, 2025 09:02
@chungquantin chungquantin force-pushed the chungquantin/sync-pallet-nfts-stable2503 branch from a3089ab to fd99b50 Compare May 5, 2025 11:06
/// A type alias for handling balance deposits.
pub(super) type DepositBalanceOf<T, I = ()> =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -254,6 +254,9 @@ pub mod pallet {
/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;

/// Provider for the block number. Normally this is the `frame_system` pallet.
type BlockNumberProvider: BlockNumberProvider;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sp-api.workspace = true

[features]
default = [ "std" ]
std = [ "codec/std", "pallet-nfts/std", "sp-api/std" ]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chungquantin chungquantin requested a review from a team May 5, 2025 13:21
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Weights of pallet-nfts and nonfungibles were re-generated.

Copy link
Collaborator

@al3mart al3mart left a comment

Choose a reason for hiding this comment

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

Awesome! It looks great!

I've left one comment to clarify if we really need BlockNumberProvider in the api.
Given that we are using
type BlockNumberFor<T> = pallet_nfts::BlockNumberFor<T, NftsInstanceOf<T>>; it seems that we could be good without adding a new type to the trait ?

Once that is clarified I'm happy to approve 👌

Copy link
Collaborator

@Daanvdplas Daanvdplas left a comment

Choose a reason for hiding this comment

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

Looking good, two nitpicks but nothing to stop this from going in.

@@ -66,7 +66,7 @@ use frame_support::{
use frame_system::Config as SystemConfig;
pub use pallet::*;
use sp_runtime::{
traits::{IdentifyAccount, Saturating, StaticLookup, Verify, Zero},
traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify, Zero},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unused Zero import

@@ -960,18 +956,14 @@ impl WeightInfo for () {
/// The range of component `m` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy(m: u32, c: u32, a: u32, ) -> Weight {
fn destroy(_m: u32, _c: u32, a: u32, ) -> Weight {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure whether the weights had to changed because now the complexity parameters are not used (often because the benchmarks are ran with too little steps and repetitions.

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

Successfully merging this pull request may close these issues.

4 participants