From 233dc1260ec21ebb41b8fc3818a956a6587d1b69 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 12:40:54 +0700 Subject: [PATCH 01/18] fix visibility for pallet_nfts types used as call arguments Changes from the commit: https://github.com/paritytech/polkadot-sdk/pull/3634 --- pallets/nfts/src/types.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pallets/nfts/src/types.rs b/pallets/nfts/src/types.rs index b34d7c916..3838c2cc1 100644 --- a/pallets/nfts/src/types.rs +++ b/pallets/nfts/src/types.rs @@ -274,13 +274,13 @@ pub struct ItemMetadata> { )] pub struct ItemTip { /// The collection of the item. - pub(super) collection: CollectionId, + pub collection: CollectionId, /// An item of which the tip is sent for. - pub(super) item: ItemId, + pub item: ItemId, /// A sender of the tip. - pub(super) receiver: AccountId, + pub receiver: AccountId, /// An amount the sender is willing to tip. - pub(super) amount: Amount, + pub amount: Amount, } /// Information about the pending swap. @@ -378,9 +378,9 @@ pub enum PriceDirection { )] pub struct PriceWithDirection { /// An amount. - pub(super) amount: Amount, + pub amount: Amount, /// A direction (send or receive). - pub(super) direction: PriceDirection, + pub direction: PriceDirection, } /// Support for up to 64 user-enabled features on a collection. @@ -776,31 +776,31 @@ impl_codec_bitflags!(CollectionRoles, u8, CollectionRole); #[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub struct PreSignedMint { /// A collection of the item to be minted. - pub(super) collection: CollectionId, + pub collection: CollectionId, /// Item's ID. - pub(super) item: ItemId, + pub item: ItemId, /// Additional item's key-value attributes. - pub(super) attributes: Vec<(Vec, Vec)>, + pub attributes: Vec<(Vec, Vec)>, /// Additional item's metadata. - pub(super) metadata: Vec, + pub metadata: Vec, /// Restrict the claim to a particular account. - pub(super) only_account: Option, + pub only_account: Option, /// A deadline for the signature. - pub(super) deadline: Deadline, + pub deadline: Deadline, /// An optional price the claimer would need to pay for the mint. - pub(super) mint_price: Option, + pub mint_price: Option, } #[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub struct PreSignedAttributes { /// Collection's ID. - pub(super) collection: CollectionId, + pub collection: CollectionId, /// Item's ID. - pub(super) item: ItemId, + pub item: ItemId, /// Key-value attributes. - pub(super) attributes: Vec<(Vec, Vec)>, + pub attributes: Vec<(Vec, Vec)>, /// Attributes' namespace. - pub(super) namespace: AttributeNamespace, + pub namespace: AttributeNamespace, /// A deadline for the signature. - pub(super) deadline: Deadline, + pub deadline: Deadline, } From 47e745c15081d5c5dea68326cfa142aa03f8c690 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 12:55:43 +0700 Subject: [PATCH 02/18] [pallet-nfts, pallet_uniques] - Expose private structs Changes made from upstream: https://github.com/paritytech/polkadot-sdk/pull/6087 --- pallets/nfts/src/types.rs | 357 +++++++------------------------------- 1 file changed, 59 insertions(+), 298 deletions(-) diff --git a/pallets/nfts/src/types.rs b/pallets/nfts/src/types.rs index 3838c2cc1..289749cb9 100644 --- a/pallets/nfts/src/types.rs +++ b/pallets/nfts/src/types.rs @@ -19,7 +19,7 @@ use alloc::{vec, vec::Vec}; -use codec::{DecodeWithMemTracking, EncodeLike}; +use codec::EncodeLike; use enumflags2::{bitflags, BitFlags}; use frame_support::{ pallet_prelude::{BoundedVec, MaxEncodedLen}, @@ -33,49 +33,48 @@ use super::*; use crate::macros::*; /// A type alias for handling balance deposits. -pub(super) type DepositBalanceOf = +pub type DepositBalanceOf = <>::Currency as Currency<::AccountId>>::Balance; /// A type alias representing the details of a collection. -pub(super) type CollectionDetailsFor = +pub type CollectionDetailsFor = CollectionDetails<::AccountId, DepositBalanceOf>; /// A type alias for keeping track of approvals used by a single item. -pub(super) type ApprovalsOf = BoundedBTreeMap< +pub type ApprovalsOf = BoundedBTreeMap< ::AccountId, Option>, >::ApprovalsLimit, >; /// A type alias for keeping track of approvals for an item's attributes. -pub(super) type ItemAttributesApprovals = +pub type ItemAttributesApprovals = BoundedBTreeSet<::AccountId, >::ItemAttributesApprovalsLimit>; /// A type that holds the deposit for a single item. -pub(super) type ItemDepositOf = - ItemDeposit, ::AccountId>; +pub type ItemDepositOf = ItemDeposit, ::AccountId>; /// A type that holds the deposit amount for an item's attribute. -pub(super) type AttributeDepositOf = +pub type AttributeDepositOf = AttributeDeposit, ::AccountId>; /// A type that holds the deposit amount for an item's metadata. -pub(super) type ItemMetadataDepositOf = +pub type ItemMetadataDepositOf = ItemMetadataDeposit, ::AccountId>; /// A type that holds the details of a single item. -pub(super) type ItemDetailsFor = +pub type ItemDetailsFor = ItemDetails<::AccountId, ItemDepositOf, ApprovalsOf>; /// A type alias for an accounts balance. -pub(super) type BalanceOf = +pub type BalanceOf = <>::Currency as Currency<::AccountId>>::Balance; /// A type alias to represent the price of an item. -pub(super) type ItemPrice = BalanceOf; +pub type ItemPrice = BalanceOf; /// A type alias for the tips held by a single item. -pub(super) type ItemTipOf = ItemTip< +pub type ItemTipOf = ItemTip< >::CollectionId, >::ItemId, ::AccountId, BalanceOf, >; /// A type alias for the settings configuration of a collection. -pub(super) type CollectionConfigFor = +pub type CollectionConfigFor = CollectionConfig, BlockNumberFor, >::CollectionId>; /// A type alias for the pre-signed minting configuration for a specified collection. -pub(super) type PreSignedMintOf = PreSignedMint< +pub type PreSignedMintOf = PreSignedMint< >::CollectionId, >::ItemId, ::AccountId, @@ -83,28 +82,15 @@ pub(super) type PreSignedMintOf = PreSignedMint< BalanceOf, >; /// A type alias for the pre-signed minting configuration on the attribute level of an item. -pub(super) type PreSignedAttributesOf = PreSignedAttributes< +pub type PreSignedAttributesOf = PreSignedAttributes< >::CollectionId, >::ItemId, ::AccountId, BlockNumberFor, >; -/// A type alias for the depositor account and its associated deposited amount. -pub(super) type AccountDepositOf = - (::AccountId, DepositBalanceOf); /// Information about a collection. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct CollectionDetails { /// Collection's owner. pub owner: AccountId, @@ -122,18 +108,7 @@ pub struct CollectionDetails { } /// Witness data for the destroy transactions. -#[derive( - Copy, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct DestroyWitness { /// The total number of items in this collection that have outstanding item metadata. #[codec(compact)] @@ -157,9 +132,7 @@ impl CollectionDetails { } /// Witness data for items mint transactions. -#[derive( - Clone, Encode, Decode, DecodeWithMemTracking, Default, Eq, PartialEq, RuntimeDebug, TypeInfo, -)] +#[derive(Clone, Encode, Decode, Default, Eq, PartialEq, RuntimeDebug, TypeInfo)] pub struct MintWitness { /// Provide the id of the item in a required collection. pub owned_item: Option, @@ -168,110 +141,57 @@ pub struct MintWitness { } /// Information concerning the ownership of a single unique item. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - Default, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] pub struct ItemDetails { /// The owner of this item. - pub(super) owner: AccountId, + pub owner: AccountId, /// The approved transferrer of this item, if one is set. - pub(super) approvals: Approvals, + pub approvals: Approvals, /// The amount held in the pallet's default account for this item. Free-hold items will have /// this as zero. - pub(super) deposit: Deposit, + pub deposit: Deposit, } /// Information about the reserved item deposit. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct ItemDeposit { /// A depositor account. - pub(super) account: AccountId, + pub account: AccountId, /// An amount that gets reserved. - pub(super) amount: DepositBalance, + pub amount: DepositBalance, } /// Information about the collection's metadata. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - Default, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] #[codec(mel_bound(Deposit: MaxEncodedLen))] pub struct CollectionMetadata> { /// The balance deposited for this metadata. /// /// This pays for the data stored in this struct. - pub(super) deposit: Deposit, + pub deposit: Deposit, /// General information concerning this collection. Limited in length by `StringLimit`. This /// will generally be either a JSON dump or the hash of some JSON which can be found on a /// hash-addressable global publication system such as IPFS. - pub(super) data: BoundedVec, + pub data: BoundedVec, } /// Information about the item's metadata. -#[derive( - Clone, - Encode, - Decode, - Eq, - DecodeWithMemTracking, - PartialEq, - RuntimeDebug, - Default, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] pub struct ItemMetadata> { /// The balance deposited for this metadata. /// /// This pays for the data stored in this struct. - pub(super) deposit: Deposit, + pub deposit: Deposit, /// General information concerning this item. Limited in length by `StringLimit`. This will - /// generally be either a JSON dump or the hash of some JSON which can be found on a + /// generally be either a JSON dump or the hash of some JSON which can be found on /// hash-addressable global publication system such as IPFS. - pub(super) data: BoundedVec, + pub data: BoundedVec, } /// Information about the tip. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct ItemTip { /// The collection of the item. pub collection: CollectionId, @@ -284,79 +204,38 @@ pub struct ItemTip { } /// Information about the pending swap. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - Default, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] pub struct PendingSwap { /// The collection that contains the item that the user wants to receive. - pub(super) desired_collection: CollectionId, + pub desired_collection: CollectionId, /// The item the user wants to receive. - pub(super) desired_item: Option, + pub desired_item: Option, /// A price for the desired `item` with the direction. - pub(super) price: Option, + pub price: Option, /// A deadline for the swap. - pub(super) deadline: Deadline, + pub deadline: Deadline, } /// Information about the reserved attribute deposit. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct AttributeDeposit { /// A depositor account. - pub(super) account: Option, + pub account: Option, /// An amount that gets reserved. - pub(super) amount: DepositBalance, + pub amount: DepositBalance, } /// Information about the reserved item's metadata deposit. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct ItemMetadataDeposit { /// A depositor account, None means the deposit is collection's owner. - pub(super) account: Option, + pub account: Option, /// An amount that gets reserved. - pub(super) amount: DepositBalance, + pub amount: DepositBalance, } /// Specifies whether the tokens will be sent or received. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub enum PriceDirection { /// Tokens will be sent. Send, @@ -365,17 +244,7 @@ pub enum PriceDirection { } /// Holds the details about the price. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct PriceWithDirection { /// An amount. pub amount: Amount, @@ -386,18 +255,7 @@ pub struct PriceWithDirection { /// Support for up to 64 user-enabled features on a collection. #[bitflags] #[repr(u64)] -#[derive( - Copy, - Clone, - RuntimeDebug, - PartialEq, - Eq, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, -)] +#[derive(Copy, Clone, RuntimeDebug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum CollectionSetting { /// Items in this collection are transferable. TransferableItems, @@ -434,25 +292,11 @@ impl CollectionSettings { } impl_codec_bitflags!(CollectionSettings, u64, CollectionSetting); -// We can implement `DecodeWithMemTracking` for `CollectionSettings` -// since `u64` also implements `DecodeWithMemTracking`. -impl DecodeWithMemTracking for CollectionSettings {} /// Mint type. Can the NFT be create by anyone, or only the creator of the collection, /// or only by wallets that already hold an NFT from a certain collection? /// The ownership of a privately minted NFT is still publicly visible. -#[derive( - Clone, - Copy, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Copy, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub enum MintType { /// Only an `Issuer` could mint items. Issuer, @@ -463,18 +307,7 @@ pub enum MintType { } /// Holds the information about minting. -#[derive( - Clone, - Copy, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Copy, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct MintSettings { /// Whether anyone can mint or if minters are restricted to some subset. pub mint_type: MintType, @@ -502,15 +335,7 @@ impl Default for MintSettings { /// An attribute was set by the pallet. @@ -524,24 +349,14 @@ pub enum AttributeNamespace { } /// A witness data to cancel attributes approval operation. -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo)] pub struct CancelAttributesApprovalWitness { /// An amount of attributes previously created by account. pub account_attributes: u32, } /// A list of possible pallet-level attributes. -#[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, -)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub enum PalletAttributes { /// Marks an item as being used in order to claim another item. UsedToClaim(CollectionId), @@ -551,16 +366,7 @@ pub enum PalletAttributes { /// Collection's configuration. #[derive( - Clone, - Copy, - Decode, - DecodeWithMemTracking, - Default, - Encode, - MaxEncodedLen, - PartialEq, - RuntimeDebug, - TypeInfo, + Clone, Copy, Decode, Default, Encode, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo, )] pub struct CollectionConfig { /// Collection's settings. @@ -592,18 +398,7 @@ impl CollectionConfig { /// A collection of the item to be minted. pub collection: CollectionId, @@ -791,7 +552,7 @@ pub struct PreSignedMint { pub mint_price: Option, } -#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct PreSignedAttributes { /// Collection's ID. pub collection: CollectionId, From 88ecea6e5291bf7660172952ddba4ab4204a06e4 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:17:52 +0700 Subject: [PATCH 03/18] Adds BlockNumberProvider in multisig, proxy and nft pallets Upstream commit: https://github.com/paritytech/polkadot-sdk/pull/5723 --- pallets/nfts/src/features/approvals.rs | 19 +++++----- pallets/nfts/src/features/atomic_swap.rs | 9 +++-- pallets/nfts/src/features/attributes.rs | 2 +- .../nfts/src/features/create_delete_item.rs | 2 +- pallets/nfts/src/features/settings.rs | 6 +-- pallets/nfts/src/lib.rs | 37 +++++++++++-------- pallets/nfts/src/mock.rs | 1 + pallets/nfts/src/types.rs | 15 +++++--- runtime/devnet/src/config/assets.rs | 1 + 9 files changed, 50 insertions(+), 42 deletions(-) diff --git a/pallets/nfts/src/features/approvals.rs b/pallets/nfts/src/features/approvals.rs index f7db22a74..f8562a5ed 100644 --- a/pallets/nfts/src/features/approvals.rs +++ b/pallets/nfts/src/features/approvals.rs @@ -20,7 +20,6 @@ //! to have the functionality defined in this module. use frame_support::pallet_prelude::*; -use frame_system::pallet_prelude::BlockNumberFor; use crate::*; @@ -48,7 +47,7 @@ impl, I: 'static> Pallet { collection: T::CollectionId, item: T::ItemId, delegate: T::AccountId, - maybe_deadline: Option>, + maybe_deadline: Option>, ) -> DispatchResult { ensure!( Self::is_pallet_feature_enabled(PalletFeature::Approvals), @@ -66,8 +65,8 @@ impl, I: 'static> Pallet { ensure!(check_origin == details.owner, Error::::NoPermission); } - let deadline = - maybe_deadline.map(|d| d.saturating_add(frame_system::Pallet::::block_number())); + let now = T::BlockNumberProvider::current_block_number(); + let deadline = maybe_deadline.map(|d| d.saturating_add(now)); details .approvals @@ -110,7 +109,7 @@ impl, I: 'static> Pallet { let maybe_deadline = details.approvals.get(&delegate).ok_or(Error::::NotDelegate)?; let is_past_deadline = if let Some(deadline) = maybe_deadline { - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); now > *deadline } else { false @@ -212,7 +211,7 @@ impl, I: 'static> Pallet { collection: T::CollectionId, delegate: T::AccountId, deposit: DepositBalanceOf, - maybe_deadline: Option>, + maybe_deadline: Option>, ) -> DispatchResult { ensure!( Self::is_pallet_feature_enabled(PalletFeature::Approvals), @@ -230,8 +229,8 @@ impl, I: 'static> Pallet { collection_config.is_setting_enabled(CollectionSetting::TransferableItems), Error::::ItemsNonTransferable ); - let deadline = - maybe_deadline.map(|d| d.saturating_add(frame_system::Pallet::::block_number())); + let now = T::BlockNumberProvider::current_block_number(); + let deadline = maybe_deadline.map(|d| d.saturating_add(now)); CollectionApprovals::::try_mutate_exists( (&collection, &owner, &delegate), @@ -330,7 +329,7 @@ impl, I: 'static> Pallet { CollectionApprovals::::get((&collection, &owner, &delegate)) .ok_or(Error::::NoPermission)?; if let Some(deadline) = maybe_deadline { - let block_number = frame_system::Pallet::::block_number(); + let block_number = T::BlockNumberProvider::current_block_number(); ensure!(block_number <= deadline, Error::::ApprovalExpired); } Ok(()) @@ -365,7 +364,7 @@ impl, I: 'static> Pallet { let maybe_deadline = details.approvals.get(delegate).ok_or(Error::::NoPermission)?; if let Some(deadline) = maybe_deadline { - let block_number = frame_system::Pallet::::block_number(); + let block_number = T::BlockNumberProvider::current_block_number(); ensure!(block_number <= *deadline, Error::::ApprovalExpired); } return Ok(()); diff --git a/pallets/nfts/src/features/atomic_swap.rs b/pallets/nfts/src/features/atomic_swap.rs index 1ffd6dce4..4debe20f9 100644 --- a/pallets/nfts/src/features/atomic_swap.rs +++ b/pallets/nfts/src/features/atomic_swap.rs @@ -54,7 +54,7 @@ impl, I: 'static> Pallet { desired_collection_id: T::CollectionId, maybe_desired_item_id: Option, maybe_price: Option>>, - duration: frame_system::pallet_prelude::BlockNumberFor, + duration: BlockNumberFor, ) -> DispatchResult { ensure!( Self::is_pallet_feature_enabled(PalletFeature::Swaps), @@ -77,7 +77,8 @@ impl, I: 'static> Pallet { ), }; - let deadline = duration.saturating_add(frame_system::Pallet::::block_number()); + let now = T::BlockNumberProvider::current_block_number(); + let deadline = duration.saturating_add(now); PendingSwapOf::::insert( offered_collection_id, @@ -120,7 +121,7 @@ impl, I: 'static> Pallet { let swap = PendingSwapOf::::get(offered_collection_id, offered_item_id) .ok_or(Error::::UnknownSwap)?; - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); if swap.deadline > now { let item = Item::::get(offered_collection_id, offered_item_id) .ok_or(Error::::UnknownItem)?; @@ -188,7 +189,7 @@ impl, I: 'static> Pallet { ensure!(desired_item == send_item_id, Error::::UnknownSwap); } - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); ensure!(now <= swap.deadline, Error::::DeadlineExpired); if let Some(ref price) = swap.price { diff --git a/pallets/nfts/src/features/attributes.rs b/pallets/nfts/src/features/attributes.rs index b7ba769ae..4b15e2dbb 100644 --- a/pallets/nfts/src/features/attributes.rs +++ b/pallets/nfts/src/features/attributes.rs @@ -225,7 +225,7 @@ impl, I: 'static> Pallet { Error::::MaxAttributesLimitReached ); - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); ensure!(deadline >= now, Error::::DeadlineExpired); let item_details = Item::::get(collection, item).ok_or(Error::::UnknownItem)?; diff --git a/pallets/nfts/src/features/create_delete_item.rs b/pallets/nfts/src/features/create_delete_item.rs index 5c687d427..4c4f39c87 100644 --- a/pallets/nfts/src/features/create_delete_item.rs +++ b/pallets/nfts/src/features/create_delete_item.rs @@ -148,7 +148,7 @@ impl, I: 'static> Pallet { ensure!(account == mint_to, Error::::WrongOrigin); } - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); ensure!(deadline >= now, Error::::DeadlineExpired); ensure!( diff --git a/pallets/nfts/src/features/settings.rs b/pallets/nfts/src/features/settings.rs index 22495bc95..577247151 100644 --- a/pallets/nfts/src/features/settings.rs +++ b/pallets/nfts/src/features/settings.rs @@ -97,11 +97,7 @@ impl, I: 'static> Pallet { pub(crate) fn do_update_mint_settings( maybe_check_origin: Option, collection: T::CollectionId, - mint_settings: MintSettings< - BalanceOf, - frame_system::pallet_prelude::BlockNumberFor, - T::CollectionId, - >, + mint_settings: MintSettings, BlockNumberFor, T::CollectionId>, ) -> DispatchResult { if let Some(check_origin) = &maybe_check_origin { ensure!( diff --git a/pallets/nfts/src/lib.rs b/pallets/nfts/src/lib.rs index 2526d8366..6e31f25a0 100644 --- a/pallets/nfts/src/lib.rs +++ b/pallets/nfts/src/lib.rs @@ -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}, RuntimeDebug, }; pub use types::*; @@ -81,7 +81,7 @@ type AccountIdLookupOf = <::Lookup as StaticLookup>::Sourc #[frame_support::pallet] pub mod pallet { use frame_support::{pallet_prelude::*, traits::ExistenceRequirement}; - use frame_system::pallet_prelude::*; + use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use super::*; @@ -221,7 +221,7 @@ pub mod pallet { /// The max duration in blocks for deadlines. #[pallet::constant] - type MaxDeadlineDuration: Get>; + type MaxDeadlineDuration: Get>; /// The max number of attributes a user could set per call. #[pallet::constant] @@ -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; + /// The basic amount of funds that must be reserved for a collection approval. // Key: `sizeof((CollectionId, AccountId, AccountId))` bytes. // Value: `sizeof((Option, Balance))` bytes. @@ -411,7 +414,7 @@ pub mod pallet { T::CollectionId, T::ItemId, PriceWithDirection>, - BlockNumberFor, + BlockNumberFor, >, OptionQuery, >; @@ -457,7 +460,7 @@ pub mod pallet { ( // The optional deadline for the approval. If specified, the approval is valid on or // before the given block number. - Option>, + Option>, // The balance to be deposited. DepositBalanceOf, ), @@ -514,7 +517,7 @@ pub mod pallet { item: Option, owner: T::AccountId, delegate: T::AccountId, - deadline: Option>, + deadline: Option>, }, /// An approval for a `delegate` account to transfer a specific `item` in a `collection`, /// or if no `item` is provided, all collection items owned by the `owner` have been @@ -610,7 +613,7 @@ pub mod pallet { desired_collection: T::CollectionId, desired_item: Option, price: Option>>, - deadline: BlockNumberFor, + deadline: BlockNumberFor, }, /// The swap was cancelled. SwapCancelled { @@ -619,7 +622,7 @@ pub mod pallet { desired_collection: T::CollectionId, desired_item: Option, price: Option>>, - deadline: BlockNumberFor, + deadline: BlockNumberFor, }, /// The swap has been claimed. SwapClaimed { @@ -630,7 +633,7 @@ pub mod pallet { received_item: T::ItemId, received_item_owner: T::AccountId, price: Option>>, - deadline: BlockNumberFor, + deadline: BlockNumberFor, }, /// New attributes have been set for an `item` of the `collection`. PreSignedAttributesSet { @@ -749,7 +752,9 @@ pub mod pallet { } #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + impl, I: 'static> Hooks> + for Pallet + { #[cfg(any(feature = "std", test))] fn integrity_test() { use core::any::TypeId; @@ -931,7 +936,7 @@ pub mod pallet { item_config, |collection_details, collection_config| { let mint_settings = collection_config.mint_settings; - let now = frame_system::Pallet::::block_number(); + let now = T::BlockNumberProvider::current_block_number(); if let Some(start_block) = mint_settings.start_block { ensure!(start_block <= now, Error::::MintNotStarted); @@ -1370,7 +1375,7 @@ pub mod pallet { collection: T::CollectionId, item: T::ItemId, delegate: AccountIdLookupOf, - maybe_deadline: Option>, + maybe_deadline: Option>, ) -> DispatchResult { let maybe_check_origin = T::ForceOrigin::try_origin(origin) .map(|_| None) @@ -1793,7 +1798,7 @@ pub mod pallet { pub fn update_mint_settings( origin: OriginFor, collection: T::CollectionId, - mint_settings: MintSettings, BlockNumberFor, T::CollectionId>, + mint_settings: MintSettings, BlockNumberFor, T::CollectionId>, ) -> DispatchResult { let maybe_check_origin = T::ForceOrigin::try_origin(origin) .map(|_| None) @@ -1889,7 +1894,7 @@ pub mod pallet { desired_collection: T::CollectionId, maybe_desired_item: Option, maybe_price: Option>>, - duration: BlockNumberFor, + duration: BlockNumberFor, ) -> DispatchResult { let origin = ensure_signed(origin)?; Self::do_create_swap( @@ -2029,7 +2034,7 @@ pub mod pallet { origin: OriginFor, collection: T::CollectionId, delegate: AccountIdLookupOf, - maybe_deadline: Option>, + maybe_deadline: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; let delegate = T::Lookup::lookup(delegate)?; @@ -2066,7 +2071,7 @@ pub mod pallet { owner: AccountIdLookupOf, collection: T::CollectionId, delegate: AccountIdLookupOf, - maybe_deadline: Option>, + maybe_deadline: Option>, ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; let delegate = T::Lookup::lookup(delegate)?; diff --git a/pallets/nfts/src/mock.rs b/pallets/nfts/src/mock.rs index efd72722f..1f75fcaf3 100644 --- a/pallets/nfts/src/mock.rs +++ b/pallets/nfts/src/mock.rs @@ -65,6 +65,7 @@ parameter_types! { impl Config for Test { type ApprovalsLimit = ConstU32<10>; type AttributeDepositBase = ConstU64<1>; + type BlockNumberProvider = frame_system::Pallet; type CollectionApprovalDeposit = ConstU64<1>; type CollectionBalanceDeposit = ConstU64<1>; type CollectionDeposit = ConstU64<2>; diff --git a/pallets/nfts/src/types.rs b/pallets/nfts/src/types.rs index 289749cb9..7b609fab4 100644 --- a/pallets/nfts/src/types.rs +++ b/pallets/nfts/src/types.rs @@ -26,12 +26,14 @@ use frame_support::{ traits::Get, BoundedBTreeMap, BoundedBTreeSet, }; -use frame_system::pallet_prelude::BlockNumberFor; use scale_info::{build::Fields, meta_type, Path, Type, TypeInfo, TypeParameter}; use super::*; use crate::macros::*; +/// A type alias for a block number. +pub type BlockNumberFor = + <>::BlockNumberProvider as BlockNumberProvider>::BlockNumber; /// A type alias for handling balance deposits. pub type DepositBalanceOf = <>::Currency as Currency<::AccountId>>::Balance; @@ -41,7 +43,7 @@ pub type CollectionDetailsFor = /// A type alias for keeping track of approvals used by a single item. pub type ApprovalsOf = BoundedBTreeMap< ::AccountId, - Option>, + Option>, >::ApprovalsLimit, >; /// A type alias for keeping track of approvals for an item's attributes. @@ -72,13 +74,13 @@ pub type ItemTipOf = ItemTip< >; /// A type alias for the settings configuration of a collection. pub type CollectionConfigFor = - CollectionConfig, BlockNumberFor, >::CollectionId>; + CollectionConfig, BlockNumberFor, >::CollectionId>; /// A type alias for the pre-signed minting configuration for a specified collection. pub type PreSignedMintOf = PreSignedMint< >::CollectionId, >::ItemId, ::AccountId, - BlockNumberFor, + BlockNumberFor, BalanceOf, >; /// A type alias for the pre-signed minting configuration on the attribute level of an item. @@ -86,9 +88,12 @@ pub type PreSignedAttributesOf = PreSignedAttributes< >::CollectionId, >::ItemId, ::AccountId, - BlockNumberFor, + BlockNumberFor, >; +/// A type alias for the depositor account and its associated deposited amount. +pub type AccountDepositOf = (::AccountId, DepositBalanceOf); + /// Information about a collection. #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct CollectionDetails { diff --git a/runtime/devnet/src/config/assets.rs b/runtime/devnet/src/config/assets.rs index b5dd4120f..487f0fe7c 100644 --- a/runtime/devnet/src/config/assets.rs +++ b/runtime/devnet/src/config/assets.rs @@ -64,6 +64,7 @@ impl pallet_nfts::Config for Runtime { // TODO: source from primitives type ApprovalsLimit = ConstU32<20>; type AttributeDepositBase = NftsAttributeDepositBase; + type BlockNumberProvider = frame_system::Pallet; type CollectionApprovalDeposit = NftsCollectionApprovalDeposit; type CollectionBalanceDeposit = NftsCollectionBalanceDeposit; type CollectionDeposit = NftsCollectionDeposit; From 4a6633f75a4599420755aa3afbda1db3847eacb1 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:24:35 +0700 Subject: [PATCH 04/18] Removed unused dependencies (partial progress) Upstream commit: https://github.com/paritytech/polkadot-sdk/pull/7329 --- pallets/api/src/mock.rs | 1 + pallets/nfts/runtime-api/Cargo.toml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 614f484ae..48caa6caa 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -167,6 +167,7 @@ type NftsInstance = pallet_nfts::Instance1; impl pallet_nfts::Config for Test { type ApprovalsLimit = ConstU32<10>; type AttributeDepositBase = ConstU128<1>; + type BlockNumberProvider = frame_system::Pallet; type CollectionApprovalDeposit = ConstU128<1>; type CollectionBalanceDeposit = ConstU128<1>; type CollectionDeposit = ConstU128<2>; diff --git a/pallets/nfts/runtime-api/Cargo.toml b/pallets/nfts/runtime-api/Cargo.toml index 66814bdef..56fb1b55f 100644 --- a/pallets/nfts/runtime-api/Cargo.toml +++ b/pallets/nfts/runtime-api/Cargo.toml @@ -14,9 +14,8 @@ targets = [ "x86_64-unknown-linux-gnu" ] [dependencies] codec = { features = [ "derive" ], workspace = true } -pallet-nfts.workspace = true sp-api.workspace = true [features] default = [ "std" ] -std = [ "codec/std", "pallet-nfts/std", "sp-api/std" ] +std = [ "codec/std", "sp-api/std" ] From b3c2fe3e4f2c1ca6b85c22da24d9dd521ee78880 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:30:57 +0700 Subject: [PATCH 05/18] implement DecodeWithMemTracking for frame pallets https://github.com/paritytech/polkadot-sdk/pull/7598 --- pallets/nfts/src/types.rs | 137 +++++++++++++++++++++++++++++++++----- 1 file changed, 122 insertions(+), 15 deletions(-) diff --git a/pallets/nfts/src/types.rs b/pallets/nfts/src/types.rs index 7b609fab4..7e21fb163 100644 --- a/pallets/nfts/src/types.rs +++ b/pallets/nfts/src/types.rs @@ -19,7 +19,7 @@ use alloc::{vec, vec::Vec}; -use codec::EncodeLike; +use codec::{DecodeWithMemTracking, EncodeLike}; use enumflags2::{bitflags, BitFlags}; use frame_support::{ pallet_prelude::{BoundedVec, MaxEncodedLen}, @@ -113,7 +113,18 @@ pub struct CollectionDetails { } /// Witness data for the destroy transactions. -#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, + Clone, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub struct DestroyWitness { /// The total number of items in this collection that have outstanding item metadata. #[codec(compact)] @@ -137,7 +148,9 @@ impl CollectionDetails { } /// Witness data for items mint transactions. -#[derive(Clone, Encode, Decode, Default, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive( + Clone, Encode, Decode, DecodeWithMemTracking, Default, Eq, PartialEq, RuntimeDebug, TypeInfo, +)] pub struct MintWitness { /// Provide the id of the item in a required collection. pub owned_item: Option, @@ -196,7 +209,17 @@ pub struct ItemMetadata> { } /// Information about the tip. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub struct ItemTip { /// The collection of the item. pub collection: CollectionId, @@ -240,7 +263,17 @@ pub struct ItemMetadataDeposit { } /// Specifies whether the tokens will be sent or received. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub enum PriceDirection { /// Tokens will be sent. Send, @@ -249,7 +282,17 @@ pub enum PriceDirection { } /// Holds the details about the price. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub struct PriceWithDirection { /// An amount. pub amount: Amount, @@ -297,11 +340,25 @@ impl CollectionSettings { } impl_codec_bitflags!(CollectionSettings, u64, CollectionSetting); +// We can implement `DecodeWithMemTracking` for `CollectionSettings` +// since `u64` also implements `DecodeWithMemTracking`. +impl DecodeWithMemTracking for CollectionSettings {} /// Mint type. Can the NFT be create by anyone, or only the creator of the collection, /// or only by wallets that already hold an NFT from a certain collection? /// The ownership of a privately minted NFT is still publicly visible. -#[derive(Clone, Copy, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Copy, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub enum MintType { /// Only an `Issuer` could mint items. Issuer, @@ -312,7 +369,18 @@ pub enum MintType { } /// Holds the information about minting. -#[derive(Clone, Copy, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Copy, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub struct MintSettings { /// Whether anyone can mint or if minters are restricted to some subset. pub mint_type: MintType, @@ -340,7 +408,15 @@ impl Default for MintSettings { /// An attribute was set by the pallet. @@ -354,14 +430,24 @@ pub enum AttributeNamespace { } /// A witness data to cancel attributes approval operation. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, RuntimeDebug, TypeInfo)] pub struct CancelAttributesApprovalWitness { /// An amount of attributes previously created by account. pub account_attributes: u32, } /// A list of possible pallet-level attributes. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive( + Clone, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, +)] pub enum PalletAttributes { /// Marks an item as being used in order to claim another item. UsedToClaim(CollectionId), @@ -371,7 +457,16 @@ pub enum PalletAttributes { /// Collection's configuration. #[derive( - Clone, Copy, Decode, Default, Encode, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo, + Clone, + Copy, + Decode, + DecodeWithMemTracking, + Default, + Encode, + MaxEncodedLen, + PartialEq, + RuntimeDebug, + TypeInfo, )] pub struct CollectionConfig { /// Collection's settings. @@ -436,10 +531,22 @@ impl ItemSettings { } impl_codec_bitflags!(ItemSettings, u64, ItemSetting); +// We can implement `DecodeWithMemTracking` for `ItemSettings` +// since `u64` also implements `DecodeWithMemTracking`. +impl DecodeWithMemTracking for ItemSettings {} /// Item's configuration. #[derive( - Encode, Decode, Default, PartialEq, RuntimeDebug, Clone, Copy, MaxEncodedLen, TypeInfo, + Encode, + Decode, + DecodeWithMemTracking, + Default, + PartialEq, + RuntimeDebug, + Clone, + Copy, + MaxEncodedLen, + TypeInfo, )] pub struct ItemConfig { /// Item's settings. @@ -539,7 +646,7 @@ impl CollectionRoles { } impl_codec_bitflags!(CollectionRoles, u8, CollectionRole); -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub struct PreSignedMint { /// A collection of the item to be minted. pub collection: CollectionId, @@ -557,7 +664,7 @@ pub struct PreSignedMint { pub mint_price: Option, } -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub struct PreSignedAttributes { /// Collection's ID. pub collection: CollectionId, From 49b1c6808cf7004dceb57b078ccc4e52274d6329 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:32:38 +0700 Subject: [PATCH 06/18] chore: bump pallet-nfts version to 34.1.0 --- Cargo.lock | 52 ++++++++++++++++++++--------------------- pallets/nfts/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2a20aa8f..52cd2792a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,7 +966,7 @@ dependencies = [ "pallet-migrations", "pallet-multisig 40.1.0", "pallet-nft-fractionalization", - "pallet-nfts 34.1.0", + "pallet-nfts 34.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-nfts-runtime-api 26.0.0", "pallet-proxy 40.1.0", "pallet-revive", @@ -9107,7 +9107,7 @@ dependencies = [ "pallet-assets 42.0.0", "pallet-balances 41.1.0", "pallet-ismp", - "pallet-nfts 31.0.0", + "pallet-nfts 34.1.0", "parity-scale-codec", "pop-chain-extension", "scale-info", @@ -10522,27 +10522,9 @@ dependencies = [ "frame-system 40.1.0", "log", "pallet-assets 42.0.0", - "pallet-nfts 34.1.0", - "parity-scale-codec", - "scale-info", - "sp-runtime 41.1.0", -] - -[[package]] -name = "pallet-nfts" -version = "31.0.0" -dependencies = [ - "enumflags2", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-balances 41.1.0", + "pallet-nfts 34.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "scale-info", - "sp-core 36.1.0", - "sp-io 40.0.0", - "sp-keystore 0.42.0", "sp-runtime 41.1.0", ] @@ -10564,6 +10546,24 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "pallet-nfts" +version = "34.1.0" +dependencies = [ + "enumflags2", + "frame-benchmarking 40.0.0", + "frame-support 40.1.0", + "frame-system 40.1.0", + "log", + "pallet-balances 41.1.0", + "parity-scale-codec", + "scale-info", + "sp-core 36.1.0", + "sp-io 40.0.0", + "sp-keystore 0.42.0", + "sp-runtime 41.1.0", +] + [[package]] name = "pallet-nfts" version = "34.1.0" @@ -14046,7 +14046,7 @@ dependencies = [ "pallet-balances 41.1.0", "pallet-contracts", "pallet-ismp", - "pallet-nfts 31.0.0", + "pallet-nfts 34.1.0", "pallet-xcm 19.1.0", "parity-scale-codec", "pop-api", @@ -14184,7 +14184,7 @@ dependencies = [ "pallet-migrations", "pallet-motion", "pallet-multisig 40.1.0", - "pallet-nfts 34.1.0", + "pallet-nfts 34.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-preimage 40.0.0", "pallet-proxy 40.1.0", "pallet-revive", @@ -14253,7 +14253,7 @@ dependencies = [ "pallet-message-queue 43.1.0", "pallet-multisig 40.1.0", "pallet-nft-fractionalization", - "pallet-nfts 31.0.0", + "pallet-nfts 34.1.0", "pallet-nfts-runtime-api 26.0.0", "pallet-preimage 40.0.0", "pallet-proxy 40.1.0", @@ -14332,7 +14332,7 @@ dependencies = [ "pallet-message-queue 43.1.0", "pallet-motion", "pallet-multisig 40.1.0", - "pallet-nfts 34.1.0", + "pallet-nfts 34.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-nfts-runtime-api 26.0.0", "pallet-preimage 40.0.0", "pallet-proxy 40.1.0", @@ -14423,7 +14423,7 @@ dependencies = [ "pallet-motion", "pallet-multisig 40.1.0", "pallet-nft-fractionalization", - "pallet-nfts 34.1.0", + "pallet-nfts 34.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-nfts-runtime-api 26.0.0", "pallet-preimage 40.0.0", "pallet-proxy 40.1.0", diff --git a/pallets/nfts/Cargo.toml b/pallets/nfts/Cargo.toml index bef584b85..a81edd1dd 100644 --- a/pallets/nfts/Cargo.toml +++ b/pallets/nfts/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true name = "pallet-nfts" readme = "README.md" repository.workspace = true -version = "31.0.0" +version = "34.1.0" [package.metadata.docs.rs] targets = [ "x86_64-unknown-linux-gnu" ] From c584d318b92322c0a47cbd095368f2e8d420634f Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:41:33 +0700 Subject: [PATCH 07/18] feat: adds BlockNumberProvider in nonfungbiles pallet --- pallets/api/src/mock.rs | 1 + pallets/api/src/nonfungibles/mod.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 48caa6caa..3d0296ef3 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -197,6 +197,7 @@ impl pallet_nfts::Config for Test { } impl crate::nonfungibles::Config for Test { + type BlockNumberProvider = frame_system::Pallet; type NftsInstance = NftsInstance; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/api/src/nonfungibles/mod.rs b/pallets/api/src/nonfungibles/mod.rs index 78621b8b8..469a032f7 100644 --- a/pallets/api/src/nonfungibles/mod.rs +++ b/pallets/api/src/nonfungibles/mod.rs @@ -8,7 +8,6 @@ use frame_support::{ dispatch::WithPostDispatchInfo, traits::{nonfungibles_v2::Inspect, Currency}, }; -use frame_system::pallet_prelude::BlockNumberFor; pub use pallet::*; use pallet_nfts::WeightInfo as NftsWeightInfoTrait; pub use pallet_nfts::{ @@ -26,6 +25,7 @@ mod tests; /// Weights for non-fungibles dispatchables. pub mod weights; +type BlockNumberFor = pallet_nfts::BlockNumberFor>; type AccountBalanceOf = pallet_nfts::AccountBalance>; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; type AccountIdOf = ::AccountId; @@ -55,8 +55,8 @@ pub mod pallet { pallet_prelude::*, traits::Incrementable, }; - use frame_system::pallet_prelude::*; - use sp_runtime::BoundedVec; + use frame_system::{ensure_signed, pallet_prelude::OriginFor}; + use sp_runtime::{traits::BlockNumberProvider, BoundedVec}; use super::*; @@ -69,6 +69,8 @@ pub mod pallet { type NftsInstance; /// Weight information for dispatchables in this pallet. type WeightInfo: WeightInfo; + /// Provider for the block number. Normally this is the `frame_system` pallet. + type BlockNumberProvider: BlockNumberProvider; } #[pallet::pallet] From fcb2b112ec0cdae52304d028709fe97900b16c5e Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 13:51:03 +0700 Subject: [PATCH 08/18] chore: update lock file of pop-api to sync nfts --- pop-api/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop-api/Cargo.lock b/pop-api/Cargo.lock index e98f42bfb..318549aed 100644 --- a/pop-api/Cargo.lock +++ b/pop-api/Cargo.lock @@ -2272,7 +2272,7 @@ dependencies = [ [[package]] name = "pallet-nfts" -version = "31.0.0" +version = "34.1.0" dependencies = [ "enumflags2", "frame-benchmarking", From 626888e8fa64cf06d0ab6b676249b4741a25e9ea Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 14:21:48 +0700 Subject: [PATCH 09/18] chore: BlockNumberProvider for devnet nonfungibles --- runtime/devnet/src/config/api/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index e49a4c7d9..6dbec3da8 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -88,6 +88,7 @@ impl fungibles::Config for Runtime { } impl nonfungibles::Config for Runtime { + type BlockNumberProvider = frame_system::Pallet; type NftsInstance = TrustBackedNftsInstance; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); From ff2fa32e8538bcfa2098fd603a7b9fd8288d5eea Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 17:36:08 +0700 Subject: [PATCH 10/18] chore: fix benchmarking to use new BlockNumberFor --- pallets/nfts/src/benchmarking.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pallets/nfts/src/benchmarking.rs b/pallets/nfts/src/benchmarking.rs index a04580a87..d44ae6b19 100644 --- a/pallets/nfts/src/benchmarking.rs +++ b/pallets/nfts/src/benchmarking.rs @@ -26,7 +26,7 @@ use frame_support::{ traits::{EnsureOrigin, Get, UnfilteredDispatchable}, BoundedVec, }; -use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin as SystemOrigin}; +use frame_system::RawOrigin as SystemOrigin; use sp_runtime::traits::{Bounded, One}; use super::*; @@ -579,7 +579,7 @@ benchmarks_instance_pallet! { let (item, ..) = mint_item::(0); let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); }: _(SystemOrigin::Signed(caller.clone()), collection, item, delegate_lookup, Some(deadline)) verify { assert_last_event::(Event::TransferApproved { collection, item: Some(item), owner: caller, delegate, deadline: Some(deadline) }.into()); @@ -591,7 +591,7 @@ benchmarks_instance_pallet! { let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); let origin = SystemOrigin::Signed(caller.clone()).into(); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); Nfts::::approve_transfer(origin, collection, item, delegate_lookup.clone(), Some(deadline))?; }: _(SystemOrigin::Signed(caller.clone()), collection, item, delegate_lookup) verify { @@ -604,7 +604,7 @@ benchmarks_instance_pallet! { let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); let origin = SystemOrigin::Signed(caller.clone()).into(); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); Nfts::::approve_transfer(origin, collection, item, delegate_lookup.clone(), Some(deadline))?; }: _(SystemOrigin::Signed(caller.clone()), collection, item) verify { @@ -717,7 +717,7 @@ benchmarks_instance_pallet! { frame_system::Pallet::::set_block_number(One::one()); }: _(SystemOrigin::Signed(caller.clone()), collection, item1, collection, Some(item2), Some(price_with_direction.clone()), duration) verify { - let current_block = frame_system::Pallet::::block_number(); + let current_block = T::BlockNumberProvider::current_block_number(); assert_last_event::(Event::SwapCreated { offered_collection: collection, offered_item: item1, @@ -885,7 +885,7 @@ benchmarks_instance_pallet! { mint_item::(0); let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); }: _(SystemOrigin::Signed(caller.clone()), collection, delegate_lookup, Some(deadline)) verify { assert_last_event::(Event::TransferApproved { collection, item: None, owner: caller, delegate, deadline: Some(deadline) }.into()); @@ -896,7 +896,7 @@ benchmarks_instance_pallet! { mint_item::(0); let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); }: _(SystemOrigin::Root, caller_lookup, collection, delegate_lookup, Some(deadline)) verify { assert_last_event::(Event::TransferApproved { collection, item: None, owner: caller, delegate, deadline: Some(deadline) }.into()); @@ -908,7 +908,7 @@ benchmarks_instance_pallet! { let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); let origin = SystemOrigin::Signed(caller.clone()).into(); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); Nfts::::approve_collection_transfer(origin, collection, delegate_lookup.clone(), Some(deadline))?; }: _(SystemOrigin::Signed(caller.clone()), collection, delegate_lookup) verify { @@ -920,7 +920,7 @@ benchmarks_instance_pallet! { mint_item::(0); let delegate: T::AccountId = account("delegate", 0, SEED); let delegate_lookup = T::Lookup::unlookup(delegate.clone()); - let deadline = BlockNumberFor::::max_value(); + let deadline = BlockNumberFor::::max_value(); Nfts::::approve_collection_transfer(SystemOrigin::Signed(caller.clone()).into(), collection, delegate_lookup.clone(), Some(deadline))?; }: _(SystemOrigin::Root, caller_lookup, collection, delegate_lookup) verify { @@ -937,7 +937,7 @@ benchmarks_instance_pallet! { SystemOrigin::Signed(caller.clone()).into(), collection, T::Lookup::unlookup(delegate), - Some(BlockNumberFor::::max_value()), + Some(BlockNumberFor::::max_value()), )?; } }: _(SystemOrigin::Signed(caller.clone()), collection, n) @@ -956,7 +956,7 @@ benchmarks_instance_pallet! { SystemOrigin::Signed(caller.clone()).into(), collection, T::Lookup::unlookup(delegate), - Some(BlockNumberFor::::max_value()), + Some(BlockNumberFor::::max_value()), )?; } }: _(SystemOrigin::Root, caller_lookup, collection, n) From 98d2d0ea5e92023ea6a12db436c15649743d9042 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 18:10:49 +0700 Subject: [PATCH 11/18] chore: revert changes --- networks/devnet.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networks/devnet.toml b/networks/devnet.toml index 693c0e436..e27853344 100644 --- a/networks/devnet.toml +++ b/networks/devnet.toml @@ -46,7 +46,7 @@ args = [ [[parachains]] id = 1000 -chain = "asset-hub-paseo-local" +chain = "asset-hub-rococo-local" [[parachains.collators]] name = "asset-hub" From 17de2bc63745de9e85e9ed68f9114856ebaa26ee Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 18:55:48 +0700 Subject: [PATCH 12/18] fix: missing DecodeWithMemTracking --- pallets/nfts/src/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/nfts/src/tests.rs b/pallets/nfts/src/tests.rs index d0c6bff9d..8161a3f62 100644 --- a/pallets/nfts/src/tests.rs +++ b/pallets/nfts/src/tests.rs @@ -17,6 +17,7 @@ //! Tests for Nfts pallet. +use codec::DecodeWithMemTracking; use enumflags2::BitFlags; pub(crate) use frame_support::{ assert_noop, assert_ok, From deffce79744153d9c5b7da34a55a8a0c7b49a929 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 20:10:50 +0700 Subject: [PATCH 13/18] chore: update weights of pallets --- pallets/api/src/nonfungibles/weights.rs | 20 +- pallets/nfts/src/weights.rs | 398 ++++++++++++------------ 2 files changed, 206 insertions(+), 212 deletions(-) diff --git a/pallets/api/src/nonfungibles/weights.rs b/pallets/api/src/nonfungibles/weights.rs index a404511da..e7b89c098 100644 --- a/pallets/api/src/nonfungibles/weights.rs +++ b/pallets/api/src/nonfungibles/weights.rs @@ -1,25 +1,27 @@ //! Autogenerated weights for `nonfungibles` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0 +//! DATE: 2025-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `R0GUE`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop-devnet-dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/pop-node // benchmark // pallet -// --chain=dev -// --wasm-execution=compiled -// --pallet=nonfungibles +// --chain=pop-devnet-dev // --steps=50 // --repeat=20 -// --json -// --template -// ./scripts/pallet-weights-template.hbs +// --pallet=nonfungibles +// --no-storage-info +// --no-median-slopes +// --no-min-squares +// --wasm-execution=compiled +// --heap-pages=4096 // --output=./pallets/api/src/nonfungibles/weights.rs +// --template=./scripts/templates/pallet-weight-template.hbs // --extrinsic= #![cfg_attr(rustfmt, rustfmt_skip)] diff --git a/pallets/nfts/src/weights.rs b/pallets/nfts/src/weights.rs index 34e2d5408..dd9190bfd 100644 --- a/pallets/nfts/src/weights.rs +++ b/pallets/nfts/src/weights.rs @@ -17,17 +17,17 @@ //! Autogenerated weights for `pallet_nfts` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 40.0.0 -//! DATE: 2025-01-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0 +//! DATE: 2025-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `R0GUE`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop-devnet-dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/pop-node // benchmark // pallet -// --chain=dev +// --chain=pop-devnet-dev // --steps=50 // --repeat=20 // --pallet=pallet_nfts @@ -37,7 +37,7 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/nfts/src/weights.rs -// --template=./scripts/pallet-weights-template.hbs +// --template=./scripts/templates/pallet-weight-template.hbs // --extrinsic= #![cfg_attr(rustfmt, rustfmt_skip)] @@ -112,10 +112,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `105` + // Measured: `143` // Estimated: `3549` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 3549) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -133,7 +133,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3549` - // Minimum execution time: 11_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(12_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) @@ -159,18 +159,14 @@ impl WeightInfo for SubstrateWeight { /// 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 { // Proof Size summary in bytes: - // Measured: `32137 + a * (366 ±0)` + // Measured: `32173 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 902_000_000 picoseconds. - Weight::from_parts(786_614_356, 2523990) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(85_114, 0).saturating_mul(m.into())) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(52_018, 0).saturating_mul(c.into())) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(4_806_613, 0).saturating_mul(a.into())) + // Minimum execution time: 935_000_000 picoseconds. + Weight::from_parts(1_154_162_415, 2523990) + // Standard Error: 16_463 + .saturating_add(Weight::from_parts(5_225_721, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1005_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1005_u64)) @@ -195,8 +191,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(38_000_000, 4326) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(44_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -218,8 +214,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 4326) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(41_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -247,8 +243,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `634` // Estimated: `4326` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(41_000_000, 4326) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(49_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -276,8 +272,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `696` // Estimated: `6180` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(52_000_000, 6180) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(56_000_000, 6180) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -292,10 +288,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `690 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 3549) - // Standard Error: 24_440 - .saturating_add(Weight::from_parts(12_497_458, 0).saturating_mul(i.into())) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3549) + // Standard Error: 36_854 + .saturating_add(Weight::from_parts(12_261_857, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -309,8 +305,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 3534) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -322,8 +318,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 3534) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -350,10 +346,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `417` + // Measured: `489` // Estimated: `3593` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3593) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 3593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -365,8 +361,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `296` // Estimated: `6078` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(68_000_000, 6078) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(26_000_000, 6078) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -391,7 +387,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3549` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3549) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -405,7 +401,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `395` // Estimated: `3534` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(13_000_000, 3534) + Weight::from_parts(12_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -423,8 +419,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3944` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(31_000_000, 3944) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(35_000_000, 3944) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -453,8 +449,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `943` // Estimated: `3944` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 3944) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(32_000_000, 3944) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -467,7 +463,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `308` // Estimated: `4466` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(12_000_000, 4466) + Weight::from_parts(11_000_000, 4466) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -482,12 +478,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1000]`. fn cancel_item_attributes_approval(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + n * (398 ±0)` + // Measured: `758 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(17_000_000, 4466) - // Standard Error: 8_501 - .saturating_add(Weight::from_parts(4_744_468, 0).saturating_mul(n.into())) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4466) + // Standard Error: 6_147 + .saturating_add(Weight::from_parts(5_199_920, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -508,8 +504,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3812` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3812) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(30_000_000, 3812) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -525,8 +521,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `3812` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3812) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 3812) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -542,8 +538,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `325` // Estimated: `3759` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 3759) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3759) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -559,8 +555,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `643` // Estimated: `3759` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 3759) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 3759) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -585,7 +581,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 11_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(12_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -598,7 +594,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(14_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -610,7 +606,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `3` // Estimated: `3517` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3517) + Weight::from_parts(8_000_000, 3517) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -623,7 +619,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `267` // Estimated: `3549` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(13_000_000, 3549) + Weight::from_parts(11_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -635,8 +631,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `250` // Estimated: `3538` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(11_000_000, 3538) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(12_000_000, 3538) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -652,7 +648,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `478` // Estimated: `4326` - // Minimum execution time: 13_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 4326) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -679,10 +675,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::PendingSwapOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) fn buy_item() -> Weight { // Proof Size summary in bytes: - // Measured: `877` + // Measured: `915` // Estimated: `6180` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(54_000_000, 6180) + // Minimum execution time: 57_000_000 picoseconds. + Weight::from_parts(64_000_000, 6180) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -692,9 +688,9 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_206_012, 0) - // Standard Error: 11_245 - .saturating_add(Weight::from_parts(1_656_192, 0).saturating_mul(n.into())) + Weight::from_parts(1_825_544, 0) + // Standard Error: 10_735 + .saturating_add(Weight::from_parts(1_732_844, 0).saturating_mul(n.into())) } /// Storage: `Nfts::Item` (r:2 w:0) /// Proof: `Nfts::Item` (`max_values`: None, `max_size`: Some(861), added: 3336, mode: `MaxEncodedLen`) @@ -704,8 +700,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `421` // Estimated: `7662` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 7662) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 7662) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -717,8 +713,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `440` // Estimated: `4326` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4326) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -744,10 +740,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::ItemPriceOf` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) fn claim_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `1118` + // Measured: `1190` // Estimated: `7662` - // Minimum execution time: 75_000_000 picoseconds. - Weight::from_parts(84_000_000, 7662) + // Minimum execution time: 84_000_000 picoseconds. + Weight::from_parts(97_000_000, 7662) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -774,12 +770,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 10]`. fn mint_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `485` + // Measured: `556` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 90_000_000 picoseconds. - Weight::from_parts(98_359_609, 6078) - // Standard Error: 115_405 - .saturating_add(Weight::from_parts(20_931_944, 0).saturating_mul(n.into())) + // Minimum execution time: 95_000_000 picoseconds. + Weight::from_parts(108_343_647, 6078) + // Standard Error: 84_004 + .saturating_add(Weight::from_parts(21_507_157, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(7_u64)) @@ -801,12 +797,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 10]`. fn set_attributes_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `514` + // Measured: `586` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(55_680_600, 4466) - // Standard Error: 107_152 - .saturating_add(Weight::from_parts(20_234_822, 0).saturating_mul(n.into())) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(58_479_483, 4466) + // Standard Error: 70_336 + .saturating_add(Weight::from_parts(21_845_247, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -823,8 +819,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(25_000_000, 3602) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 3602) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -838,8 +834,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(15_000_000, 3602) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(17_000_000, 3602) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -849,8 +845,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 3602) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 3602) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -860,8 +856,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 3602) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 3602) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -872,10 +868,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `327 + n * (75 ±0)` // Estimated: `3602 + n * (2612 ±0)` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(18_000_000, 3602) - // Standard Error: 6_993 - .saturating_add(Weight::from_parts(3_855_667, 0).saturating_mul(n.into())) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 3602) + // Standard Error: 6_147 + .saturating_add(Weight::from_parts(4_191_197, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -890,8 +886,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3602 + n * (2612 ±0)` // Minimum execution time: 19_000_000 picoseconds. Weight::from_parts(20_000_000, 3602) - // Standard Error: 6_538 - .saturating_add(Weight::from_parts(3_823_979, 0).saturating_mul(n.into())) + // Standard Error: 5_434 + .saturating_add(Weight::from_parts(4_208_061, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -913,10 +909,10 @@ impl WeightInfo for () { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `105` + // Measured: `143` // Estimated: `3549` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 3549) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -934,7 +930,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3549` - // Minimum execution time: 11_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(12_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) @@ -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 { // Proof Size summary in bytes: - // Measured: `32137 + a * (366 ±0)` + // Measured: `32173 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 902_000_000 picoseconds. - Weight::from_parts(786_614_356, 2523990) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(85_114, 0).saturating_mul(m.into())) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(52_018, 0).saturating_mul(c.into())) - // Standard Error: 18_860 - .saturating_add(Weight::from_parts(4_806_613, 0).saturating_mul(a.into())) + // Minimum execution time: 935_000_000 picoseconds. + Weight::from_parts(1_154_162_415, 2523990) + // Standard Error: 16_463 + .saturating_add(Weight::from_parts(5_225_721, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().reads(1005_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(RocksDbWeight::get().writes(1005_u64)) @@ -996,8 +988,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(38_000_000, 4326) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(44_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1019,8 +1011,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 4326) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(41_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1048,8 +1040,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `634` // Estimated: `4326` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(41_000_000, 4326) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(49_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -1077,8 +1069,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `696` // Estimated: `6180` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(52_000_000, 6180) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(56_000_000, 6180) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -1093,10 +1085,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `690 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 3549) - // Standard Error: 24_440 - .saturating_add(Weight::from_parts(12_497_458, 0).saturating_mul(i.into())) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3549) + // Standard Error: 36_854 + .saturating_add(Weight::from_parts(12_261_857, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -1110,8 +1102,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 3534) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1123,8 +1115,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 3534) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1151,10 +1143,10 @@ impl WeightInfo for () { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `417` + // Measured: `489` // Estimated: `3593` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3593) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 3593) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1166,8 +1158,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `296` // Estimated: `6078` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(68_000_000, 6078) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(26_000_000, 6078) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1192,7 +1184,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3549` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1206,7 +1198,7 @@ impl WeightInfo for () { // Measured: `395` // Estimated: `3534` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(13_000_000, 3534) + Weight::from_parts(12_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1224,8 +1216,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3944` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(31_000_000, 3944) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(35_000_000, 3944) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1254,8 +1246,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `943` // Estimated: `3944` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 3944) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(32_000_000, 3944) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1268,7 +1260,7 @@ impl WeightInfo for () { // Measured: `308` // Estimated: `4466` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(12_000_000, 4466) + Weight::from_parts(11_000_000, 4466) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1283,12 +1275,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1000]`. fn cancel_item_attributes_approval(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + n * (398 ±0)` + // Measured: `758 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(17_000_000, 4466) - // Standard Error: 8_501 - .saturating_add(Weight::from_parts(4_744_468, 0).saturating_mul(n.into())) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4466) + // Standard Error: 6_147 + .saturating_add(Weight::from_parts(5_199_920, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1309,8 +1301,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3812` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3812) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(30_000_000, 3812) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1326,8 +1318,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `3812` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3812) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 3812) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1343,8 +1335,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `325` // Estimated: `3759` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 3759) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3759) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1360,8 +1352,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `643` // Estimated: `3759` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 3759) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 3759) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1386,7 +1378,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 11_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(12_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1399,7 +1391,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(14_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1411,7 +1403,7 @@ impl WeightInfo for () { // Measured: `3` // Estimated: `3517` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3517) + Weight::from_parts(8_000_000, 3517) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1424,7 +1416,7 @@ impl WeightInfo for () { // Measured: `267` // Estimated: `3549` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(13_000_000, 3549) + Weight::from_parts(11_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1436,8 +1428,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `250` // Estimated: `3538` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(11_000_000, 3538) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(12_000_000, 3538) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1453,7 +1445,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `478` // Estimated: `4326` - // Minimum execution time: 13_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1480,10 +1472,10 @@ impl WeightInfo for () { /// Proof: `Nfts::PendingSwapOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) fn buy_item() -> Weight { // Proof Size summary in bytes: - // Measured: `877` + // Measured: `915` // Estimated: `6180` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(54_000_000, 6180) + // Minimum execution time: 57_000_000 picoseconds. + Weight::from_parts(64_000_000, 6180) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -1493,9 +1485,9 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_206_012, 0) - // Standard Error: 11_245 - .saturating_add(Weight::from_parts(1_656_192, 0).saturating_mul(n.into())) + Weight::from_parts(1_825_544, 0) + // Standard Error: 10_735 + .saturating_add(Weight::from_parts(1_732_844, 0).saturating_mul(n.into())) } /// Storage: `Nfts::Item` (r:2 w:0) /// Proof: `Nfts::Item` (`max_values`: None, `max_size`: Some(861), added: 3336, mode: `MaxEncodedLen`) @@ -1505,8 +1497,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `421` // Estimated: `7662` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 7662) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 7662) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1518,8 +1510,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `440` // Estimated: `4326` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4326) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1545,10 +1537,10 @@ impl WeightInfo for () { /// Proof: `Nfts::ItemPriceOf` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) fn claim_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `1118` + // Measured: `1190` // Estimated: `7662` - // Minimum execution time: 75_000_000 picoseconds. - Weight::from_parts(84_000_000, 7662) + // Minimum execution time: 84_000_000 picoseconds. + Weight::from_parts(97_000_000, 7662) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -1575,12 +1567,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 10]`. fn mint_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `485` + // Measured: `556` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 90_000_000 picoseconds. - Weight::from_parts(98_359_609, 6078) - // Standard Error: 115_405 - .saturating_add(Weight::from_parts(20_931_944, 0).saturating_mul(n.into())) + // Minimum execution time: 95_000_000 picoseconds. + Weight::from_parts(108_343_647, 6078) + // Standard Error: 84_004 + .saturating_add(Weight::from_parts(21_507_157, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(7_u64)) @@ -1602,12 +1594,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 10]`. fn set_attributes_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `514` + // Measured: `586` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(55_680_600, 4466) - // Standard Error: 107_152 - .saturating_add(Weight::from_parts(20_234_822, 0).saturating_mul(n.into())) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(58_479_483, 4466) + // Standard Error: 70_336 + .saturating_add(Weight::from_parts(21_845_247, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1624,8 +1616,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(25_000_000, 3602) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1639,8 +1631,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(15_000_000, 3602) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(17_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1650,8 +1642,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 3602) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1661,8 +1653,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 3602) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1673,10 +1665,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `327 + n * (75 ±0)` // Estimated: `3602 + n * (2612 ±0)` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(18_000_000, 3602) - // Standard Error: 6_993 - .saturating_add(Weight::from_parts(3_855_667, 0).saturating_mul(n.into())) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 3602) + // Standard Error: 6_147 + .saturating_add(Weight::from_parts(4_191_197, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -1691,8 +1683,8 @@ impl WeightInfo for () { // Estimated: `3602 + n * (2612 ±0)` // Minimum execution time: 19_000_000 picoseconds. Weight::from_parts(20_000_000, 3602) - // Standard Error: 6_538 - .saturating_add(Weight::from_parts(3_823_979, 0).saturating_mul(n.into())) + // Standard Error: 5_434 + .saturating_add(Weight::from_parts(4_208_061, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) From ebb59188c66aa5ffabf77e6dd460b8cfb59aec9e Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 5 May 2025 23:11:36 +0700 Subject: [PATCH 14/18] refactor(nonfungibles): remove unused BlockNumberProvider type --- pallets/api/src/mock.rs | 1 - pallets/api/src/nonfungibles/mod.rs | 4 +--- runtime/devnet/src/config/api/mod.rs | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 3d0296ef3..48caa6caa 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -197,7 +197,6 @@ impl pallet_nfts::Config for Test { } impl crate::nonfungibles::Config for Test { - type BlockNumberProvider = frame_system::Pallet; type NftsInstance = NftsInstance; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/api/src/nonfungibles/mod.rs b/pallets/api/src/nonfungibles/mod.rs index 469a032f7..e5e8b2e47 100644 --- a/pallets/api/src/nonfungibles/mod.rs +++ b/pallets/api/src/nonfungibles/mod.rs @@ -56,7 +56,7 @@ pub mod pallet { traits::Incrementable, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; - use sp_runtime::{traits::BlockNumberProvider, BoundedVec}; + use sp_runtime::BoundedVec; use super::*; @@ -69,8 +69,6 @@ pub mod pallet { type NftsInstance; /// Weight information for dispatchables in this pallet. type WeightInfo: WeightInfo; - /// Provider for the block number. Normally this is the `frame_system` pallet. - type BlockNumberProvider: BlockNumberProvider; } #[pallet::pallet] diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 6dbec3da8..e49a4c7d9 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -88,7 +88,6 @@ impl fungibles::Config for Runtime { } impl nonfungibles::Config for Runtime { - type BlockNumberProvider = frame_system::Pallet; type NftsInstance = TrustBackedNftsInstance; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); From 21accad36c4914ad2778f5b22ec0206ef0819ba8 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 6 May 2025 10:37:53 +0700 Subject: [PATCH 15/18] chore: remove unused Zero trait --- pallets/nfts/src/benchmarking.rs | 2 +- pallets/nfts/src/lib.rs | 2 +- pallets/nfts/src/tests.rs | 2 +- pallets/nfts/src/weights.rs | 398 ++++++++++++++++--------------- 4 files changed, 206 insertions(+), 198 deletions(-) diff --git a/pallets/nfts/src/benchmarking.rs b/pallets/nfts/src/benchmarking.rs index d44ae6b19..0b3f4eda9 100644 --- a/pallets/nfts/src/benchmarking.rs +++ b/pallets/nfts/src/benchmarking.rs @@ -27,7 +27,7 @@ use frame_support::{ BoundedVec, }; use frame_system::RawOrigin as SystemOrigin; -use sp_runtime::traits::{Bounded, One}; +use sp_runtime::traits::{Bounded, One, Zero}; use super::*; use crate::Pallet as Nfts; diff --git a/pallets/nfts/src/lib.rs b/pallets/nfts/src/lib.rs index 6e31f25a0..438876d7b 100644 --- a/pallets/nfts/src/lib.rs +++ b/pallets/nfts/src/lib.rs @@ -66,7 +66,7 @@ use frame_support::{ use frame_system::Config as SystemConfig; pub use pallet::*; use sp_runtime::{ - traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify, Zero}, + traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify}, RuntimeDebug, }; pub use types::*; diff --git a/pallets/nfts/src/tests.rs b/pallets/nfts/src/tests.rs index 8161a3f62..ab1430cd4 100644 --- a/pallets/nfts/src/tests.rs +++ b/pallets/nfts/src/tests.rs @@ -31,7 +31,7 @@ use frame_system::pallet_prelude::BlockNumberFor; pub(crate) use pallet_balances::Error as BalancesError; use sp_core::{bounded::BoundedVec, Pair}; use sp_runtime::{ - traits::{Dispatchable, IdentifyAccount}, + traits::{Dispatchable, IdentifyAccount, Zero}, DispatchError::BadOrigin, MultiSignature, MultiSigner, }; diff --git a/pallets/nfts/src/weights.rs b/pallets/nfts/src/weights.rs index dd9190bfd..34e2d5408 100644 --- a/pallets/nfts/src/weights.rs +++ b/pallets/nfts/src/weights.rs @@ -17,17 +17,17 @@ //! Autogenerated weights for `pallet_nfts` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0 -//! DATE: 2025-05-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 40.0.0 +//! DATE: 2025-01-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `R0GUE`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop-devnet-dev")`, DB CACHE: `1024` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/pop-node // benchmark // pallet -// --chain=pop-devnet-dev +// --chain=dev // --steps=50 // --repeat=20 // --pallet=pallet_nfts @@ -37,7 +37,7 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/nfts/src/weights.rs -// --template=./scripts/templates/pallet-weight-template.hbs +// --template=./scripts/pallet-weights-template.hbs // --extrinsic= #![cfg_attr(rustfmt, rustfmt_skip)] @@ -112,10 +112,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `143` + // Measured: `105` // Estimated: `3549` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 3549) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -133,7 +133,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3549` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) @@ -159,14 +159,18 @@ impl WeightInfo for SubstrateWeight { /// 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 { // Proof Size summary in bytes: - // Measured: `32173 + a * (366 ±0)` + // Measured: `32137 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 935_000_000 picoseconds. - Weight::from_parts(1_154_162_415, 2523990) - // Standard Error: 16_463 - .saturating_add(Weight::from_parts(5_225_721, 0).saturating_mul(a.into())) + // Minimum execution time: 902_000_000 picoseconds. + Weight::from_parts(786_614_356, 2523990) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(85_114, 0).saturating_mul(m.into())) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(52_018, 0).saturating_mul(c.into())) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(4_806_613, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1005_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1005_u64)) @@ -191,8 +195,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(44_000_000, 4326) + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(38_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -214,8 +218,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 38_000_000 picoseconds. - Weight::from_parts(41_000_000, 4326) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -243,8 +247,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `634` // Estimated: `4326` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(49_000_000, 4326) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(41_000_000, 4326) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -272,8 +276,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `696` // Estimated: `6180` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(56_000_000, 6180) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(52_000_000, 6180) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -288,10 +292,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `690 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3549) - // Standard Error: 36_854 - .saturating_add(Weight::from_parts(12_261_857, 0).saturating_mul(i.into())) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 3549) + // Standard Error: 24_440 + .saturating_add(Weight::from_parts(12_497_458, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -305,8 +309,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 3534) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -318,8 +322,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 3534) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -346,10 +350,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `489` + // Measured: `417` // Estimated: `3593` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 3593) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 3593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -361,8 +365,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `296` // Estimated: `6078` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 6078) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(68_000_000, 6078) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -387,7 +391,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3549` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3549) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -401,7 +405,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `395` // Estimated: `3534` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 3534) + Weight::from_parts(13_000_000, 3534) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -419,8 +423,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3944` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(35_000_000, 3944) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(31_000_000, 3944) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -449,8 +453,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `943` // Estimated: `3944` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(32_000_000, 3944) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3944) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -463,7 +467,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `308` // Estimated: `4466` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(11_000_000, 4466) + Weight::from_parts(12_000_000, 4466) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -478,12 +482,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1000]`. fn cancel_item_attributes_approval(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `758 + n * (398 ±0)` + // Measured: `686 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4466) - // Standard Error: 6_147 - .saturating_add(Weight::from_parts(5_199_920, 0).saturating_mul(n.into())) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 4466) + // Standard Error: 8_501 + .saturating_add(Weight::from_parts(4_744_468, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -504,8 +508,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3812` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(30_000_000, 3812) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3812) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -521,8 +525,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `3812` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(27_000_000, 3812) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3812) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -538,8 +542,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `325` // Estimated: `3759` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3759) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 3759) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -555,8 +559,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `643` // Estimated: `3759` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 3759) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 3759) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -581,7 +585,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -594,7 +598,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 13_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(14_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -606,7 +610,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `3` // Estimated: `3517` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 3517) + Weight::from_parts(7_000_000, 3517) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -619,7 +623,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `267` // Estimated: `3549` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3549) + Weight::from_parts(13_000_000, 3549) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -631,8 +635,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `250` // Estimated: `3538` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(12_000_000, 3538) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 3538) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -648,7 +652,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `478` // Estimated: `4326` - // Minimum execution time: 14_000_000 picoseconds. + // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(15_000_000, 4326) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -675,10 +679,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::PendingSwapOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) fn buy_item() -> Weight { // Proof Size summary in bytes: - // Measured: `915` + // Measured: `877` // Estimated: `6180` - // Minimum execution time: 57_000_000 picoseconds. - Weight::from_parts(64_000_000, 6180) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(54_000_000, 6180) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -688,9 +692,9 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_825_544, 0) - // Standard Error: 10_735 - .saturating_add(Weight::from_parts(1_732_844, 0).saturating_mul(n.into())) + Weight::from_parts(1_206_012, 0) + // Standard Error: 11_245 + .saturating_add(Weight::from_parts(1_656_192, 0).saturating_mul(n.into())) } /// Storage: `Nfts::Item` (r:2 w:0) /// Proof: `Nfts::Item` (`max_values`: None, `max_size`: Some(861), added: 3336, mode: `MaxEncodedLen`) @@ -700,8 +704,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `421` // Estimated: `7662` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 7662) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 7662) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -713,8 +717,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `440` // Estimated: `4326` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4326) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4326) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -740,10 +744,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Nfts::ItemPriceOf` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) fn claim_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `1190` + // Measured: `1118` // Estimated: `7662` - // Minimum execution time: 84_000_000 picoseconds. - Weight::from_parts(97_000_000, 7662) + // Minimum execution time: 75_000_000 picoseconds. + Weight::from_parts(84_000_000, 7662) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -770,12 +774,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 10]`. fn mint_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `556` + // Measured: `485` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(108_343_647, 6078) - // Standard Error: 84_004 - .saturating_add(Weight::from_parts(21_507_157, 0).saturating_mul(n.into())) + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(98_359_609, 6078) + // Standard Error: 115_405 + .saturating_add(Weight::from_parts(20_931_944, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(7_u64)) @@ -797,12 +801,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 10]`. fn set_attributes_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `586` + // Measured: `514` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(58_479_483, 4466) - // Standard Error: 70_336 - .saturating_add(Weight::from_parts(21_845_247, 0).saturating_mul(n.into())) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(55_680_600, 4466) + // Standard Error: 107_152 + .saturating_add(Weight::from_parts(20_234_822, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -819,8 +823,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 3602) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(25_000_000, 3602) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -834,8 +838,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(17_000_000, 3602) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(15_000_000, 3602) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -845,8 +849,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 3602) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 3602) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -856,8 +860,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(19_000_000, 3602) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 3602) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -868,10 +872,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `327 + n * (75 ±0)` // Estimated: `3602 + n * (2612 ±0)` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 3602) - // Standard Error: 6_147 - .saturating_add(Weight::from_parts(4_191_197, 0).saturating_mul(n.into())) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(18_000_000, 3602) + // Standard Error: 6_993 + .saturating_add(Weight::from_parts(3_855_667, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -886,8 +890,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3602 + n * (2612 ±0)` // Minimum execution time: 19_000_000 picoseconds. Weight::from_parts(20_000_000, 3602) - // Standard Error: 5_434 - .saturating_add(Weight::from_parts(4_208_061, 0).saturating_mul(n.into())) + // Standard Error: 6_538 + .saturating_add(Weight::from_parts(3_823_979, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -909,10 +913,10 @@ impl WeightInfo for () { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `143` + // Measured: `105` // Estimated: `3549` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 3549) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -930,7 +934,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3549` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) @@ -956,14 +960,18 @@ 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 { // Proof Size summary in bytes: - // Measured: `32173 + a * (366 ±0)` + // Measured: `32137 + a * (366 ±0)` // Estimated: `2523990 + a * (2954 ±0)` - // Minimum execution time: 935_000_000 picoseconds. - Weight::from_parts(1_154_162_415, 2523990) - // Standard Error: 16_463 - .saturating_add(Weight::from_parts(5_225_721, 0).saturating_mul(a.into())) + // Minimum execution time: 902_000_000 picoseconds. + Weight::from_parts(786_614_356, 2523990) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(85_114, 0).saturating_mul(m.into())) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(52_018, 0).saturating_mul(c.into())) + // Standard Error: 18_860 + .saturating_add(Weight::from_parts(4_806_613, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().reads(1005_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(RocksDbWeight::get().writes(1005_u64)) @@ -988,8 +996,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(44_000_000, 4326) + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(38_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1011,8 +1019,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `4326` - // Minimum execution time: 38_000_000 picoseconds. - Weight::from_parts(41_000_000, 4326) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1040,8 +1048,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `634` // Estimated: `4326` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(49_000_000, 4326) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(41_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -1069,8 +1077,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `696` // Estimated: `6180` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(56_000_000, 6180) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(52_000_000, 6180) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -1085,10 +1093,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `690 + i * (108 ±0)` // Estimated: `3549 + i * (3336 ±0)` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3549) - // Standard Error: 36_854 - .saturating_add(Weight::from_parts(12_261_857, 0).saturating_mul(i.into())) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 3549) + // Standard Error: 24_440 + .saturating_add(Weight::from_parts(12_497_458, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(i.into()))) @@ -1102,8 +1110,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 3534) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1115,8 +1123,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3534` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 3534) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1143,10 +1151,10 @@ impl WeightInfo for () { /// Proof: `Nfts::CollectionAccount` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `489` + // Measured: `417` // Estimated: `3593` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 3593) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 3593) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1158,8 +1166,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `296` // Estimated: `6078` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 6078) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(68_000_000, 6078) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1184,7 +1192,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3549` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1198,7 +1206,7 @@ impl WeightInfo for () { // Measured: `395` // Estimated: `3534` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 3534) + Weight::from_parts(13_000_000, 3534) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1216,8 +1224,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3944` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(35_000_000, 3944) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(31_000_000, 3944) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1246,8 +1254,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `943` // Estimated: `3944` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(32_000_000, 3944) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3944) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1260,7 +1268,7 @@ impl WeightInfo for () { // Measured: `308` // Estimated: `4466` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(11_000_000, 4466) + Weight::from_parts(12_000_000, 4466) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1275,12 +1283,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1000]`. fn cancel_item_attributes_approval(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `758 + n * (398 ±0)` + // Measured: `686 + n * (398 ±0)` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4466) - // Standard Error: 6_147 - .saturating_add(Weight::from_parts(5_199_920, 0).saturating_mul(n.into())) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 4466) + // Standard Error: 8_501 + .saturating_add(Weight::from_parts(4_744_468, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1301,8 +1309,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3812` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(30_000_000, 3812) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3812) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1318,8 +1326,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `3812` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(27_000_000, 3812) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(25_000_000, 3812) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1335,8 +1343,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `325` // Estimated: `3759` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(25_000_000, 3759) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 3759) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1352,8 +1360,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `643` // Estimated: `3759` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 3759) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 3759) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1378,7 +1386,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1391,7 +1399,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `345` // Estimated: `4326` - // Minimum execution time: 13_000_000 picoseconds. + // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(14_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1403,7 +1411,7 @@ impl WeightInfo for () { // Measured: `3` // Estimated: `3517` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 3517) + Weight::from_parts(7_000_000, 3517) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1416,7 +1424,7 @@ impl WeightInfo for () { // Measured: `267` // Estimated: `3549` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3549) + Weight::from_parts(13_000_000, 3549) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1428,8 +1436,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `250` // Estimated: `3538` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(12_000_000, 3538) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 3538) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1445,7 +1453,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `478` // Estimated: `4326` - // Minimum execution time: 14_000_000 picoseconds. + // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(15_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1472,10 +1480,10 @@ impl WeightInfo for () { /// Proof: `Nfts::PendingSwapOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) fn buy_item() -> Weight { // Proof Size summary in bytes: - // Measured: `915` + // Measured: `877` // Estimated: `6180` - // Minimum execution time: 57_000_000 picoseconds. - Weight::from_parts(64_000_000, 6180) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(54_000_000, 6180) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -1485,9 +1493,9 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_825_544, 0) - // Standard Error: 10_735 - .saturating_add(Weight::from_parts(1_732_844, 0).saturating_mul(n.into())) + Weight::from_parts(1_206_012, 0) + // Standard Error: 11_245 + .saturating_add(Weight::from_parts(1_656_192, 0).saturating_mul(n.into())) } /// Storage: `Nfts::Item` (r:2 w:0) /// Proof: `Nfts::Item` (`max_values`: None, `max_size`: Some(861), added: 3336, mode: `MaxEncodedLen`) @@ -1497,8 +1505,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `421` // Estimated: `7662` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 7662) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 7662) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1510,8 +1518,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `440` // Estimated: `4326` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4326) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4326) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1537,10 +1545,10 @@ impl WeightInfo for () { /// Proof: `Nfts::ItemPriceOf` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) fn claim_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `1190` + // Measured: `1118` // Estimated: `7662` - // Minimum execution time: 84_000_000 picoseconds. - Weight::from_parts(97_000_000, 7662) + // Minimum execution time: 75_000_000 picoseconds. + Weight::from_parts(84_000_000, 7662) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -1567,12 +1575,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 10]`. fn mint_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `556` + // Measured: `485` // Estimated: `6078 + n * (2954 ±0)` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(108_343_647, 6078) - // Standard Error: 84_004 - .saturating_add(Weight::from_parts(21_507_157, 0).saturating_mul(n.into())) + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(98_359_609, 6078) + // Standard Error: 115_405 + .saturating_add(Weight::from_parts(20_931_944, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(7_u64)) @@ -1594,12 +1602,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 10]`. fn set_attributes_pre_signed(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `586` + // Measured: `514` // Estimated: `4466 + n * (2954 ±0)` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(58_479_483, 4466) - // Standard Error: 70_336 - .saturating_add(Weight::from_parts(21_845_247, 0).saturating_mul(n.into())) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(55_680_600, 4466) + // Standard Error: 107_152 + .saturating_add(Weight::from_parts(20_234_822, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1616,8 +1624,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 3602) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(25_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1631,8 +1639,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `500` // Estimated: `3602` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(17_000_000, 3602) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(15_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1642,8 +1650,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 3602) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1653,8 +1661,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `359` // Estimated: `3602` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(19_000_000, 3602) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 3602) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1665,10 +1673,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `327 + n * (75 ±0)` // Estimated: `3602 + n * (2612 ±0)` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 3602) - // Standard Error: 6_147 - .saturating_add(Weight::from_parts(4_191_197, 0).saturating_mul(n.into())) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(18_000_000, 3602) + // Standard Error: 6_993 + .saturating_add(Weight::from_parts(3_855_667, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -1683,8 +1691,8 @@ impl WeightInfo for () { // Estimated: `3602 + n * (2612 ±0)` // Minimum execution time: 19_000_000 picoseconds. Weight::from_parts(20_000_000, 3602) - // Standard Error: 5_434 - .saturating_add(Weight::from_parts(4_208_061, 0).saturating_mul(n.into())) + // Standard Error: 6_538 + .saturating_add(Weight::from_parts(3_823_979, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) From 182486a53e92a12db77fb53b5f9661c9a06b9762 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 7 May 2025 19:45:27 +0700 Subject: [PATCH 16/18] chore: revert non-relevant changes --- networks/devnet.toml | 2 +- networks/testnet.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/networks/devnet.toml b/networks/devnet.toml index e27853344..693c0e436 100644 --- a/networks/devnet.toml +++ b/networks/devnet.toml @@ -46,7 +46,7 @@ args = [ [[parachains]] id = 1000 -chain = "asset-hub-rococo-local" +chain = "asset-hub-paseo-local" [[parachains.collators]] name = "asset-hub" diff --git a/networks/testnet.toml b/networks/testnet.toml index 59d50b2d6..dc8ef71ac 100644 --- a/networks/testnet.toml +++ b/networks/testnet.toml @@ -73,4 +73,4 @@ max_message_size = 1024 sender = 4001 recipient = 1000 max_capacity = 1000 -max_message_size = 1024 \ No newline at end of file +max_message_size = 1024 From 27ddba1314117048a7c6a25ea9b296be59cb2c4c Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 7 May 2025 19:46:55 +0700 Subject: [PATCH 17/18] chore: revert non-relevant changes This reverts commit 182486a53e92a12db77fb53b5f9661c9a06b9762. --- networks/testnet.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networks/testnet.toml b/networks/testnet.toml index dc8ef71ac..59d50b2d6 100644 --- a/networks/testnet.toml +++ b/networks/testnet.toml @@ -73,4 +73,4 @@ max_message_size = 1024 sender = 4001 recipient = 1000 max_capacity = 1000 -max_message_size = 1024 +max_message_size = 1024 \ No newline at end of file From 986a3b421463e383fb6b86b9c112a3241905b84b Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 7 May 2025 22:23:05 +0700 Subject: [PATCH 18/18] chore: benchmarking replace with BlockNumberProvider --- pallets/nfts/src/benchmarking.rs | 12 ++++++------ pallets/nfts/src/tests.rs | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pallets/nfts/src/benchmarking.rs b/pallets/nfts/src/benchmarking.rs index 0b3f4eda9..affacdce5 100644 --- a/pallets/nfts/src/benchmarking.rs +++ b/pallets/nfts/src/benchmarking.rs @@ -714,7 +714,7 @@ benchmarks_instance_pallet! { let price_direction = PriceDirection::Receive; let price_with_direction = PriceWithDirection { amount: price, direction: price_direction }; let duration = T::MaxDeadlineDuration::get(); - frame_system::Pallet::::set_block_number(One::one()); + T::BlockNumberProvider::set_block_number(One::one()); }: _(SystemOrigin::Signed(caller.clone()), collection, item1, collection, Some(item2), Some(price_with_direction.clone()), duration) verify { let current_block = T::BlockNumberProvider::current_block_number(); @@ -737,7 +737,7 @@ benchmarks_instance_pallet! { let duration = T::MaxDeadlineDuration::get(); let price_direction = PriceDirection::Receive; let price_with_direction = PriceWithDirection { amount: price, direction: price_direction }; - frame_system::Pallet::::set_block_number(One::one()); + T::BlockNumberProvider::set_block_number(One::one()); Nfts::::create_swap(origin, collection, item1, collection, Some(item2), Some(price_with_direction.clone()), duration)?; }: _(SystemOrigin::Signed(caller.clone()), collection, item1) verify { @@ -763,7 +763,7 @@ benchmarks_instance_pallet! { let target_lookup = T::Lookup::unlookup(target.clone()); T::Currency::make_free_balance_be(&target, T::Currency::minimum_balance() + T::CollectionBalanceDeposit::get()); let origin = SystemOrigin::Signed(caller.clone()); - frame_system::Pallet::::set_block_number(One::one()); + T::BlockNumberProvider::set_block_number(One::one()); Nfts::::transfer(origin.clone().into(), collection, item2, target_lookup)?; Nfts::::create_swap( origin.clone().into(), @@ -776,7 +776,7 @@ benchmarks_instance_pallet! { )?; }: _(SystemOrigin::Signed(target.clone()), collection, item2, collection, item1, Some(price_with_direction.clone())) verify { - let current_block = frame_system::Pallet::::block_number(); + let currnet_block = T::BlockNumberProvider::current_block_number(); assert_last_event::(Event::SwapClaimed { sent_collection: collection, sent_item: item2, @@ -824,7 +824,7 @@ benchmarks_instance_pallet! { let target: T::AccountId = account("target", 0, SEED); T::Currency::make_free_balance_be(&target, DepositBalanceOf::::max_value()); - frame_system::Pallet::::set_block_number(One::one()); + T::BlockNumberProvider::set_block_number(One::one()); }: _(SystemOrigin::Signed(target.clone()), Box::new(mint_data), signature, caller) verify { let metadata: BoundedVec<_, _> = metadata.try_into().unwrap(); @@ -867,7 +867,7 @@ benchmarks_instance_pallet! { let message = Encode::encode(&pre_signed_data); let signature = T::Helper::sign(&signer_public, &message); - frame_system::Pallet::::set_block_number(One::one()); + T::BlockNumberProvider::set_block_number(One::one()); }: _(SystemOrigin::Signed(item_owner.clone()), pre_signed_data, signature, signer.clone()) verify { assert_last_event::( diff --git a/pallets/nfts/src/tests.rs b/pallets/nfts/src/tests.rs index ab1430cd4..a16600fdd 100644 --- a/pallets/nfts/src/tests.rs +++ b/pallets/nfts/src/tests.rs @@ -17,7 +17,6 @@ //! Tests for Nfts pallet. -use codec::DecodeWithMemTracking; use enumflags2::BitFlags; pub(crate) use frame_support::{ assert_noop, assert_ok,