[NFTs] Offchain mint (#13158)

* Allow to mint with the pre-signed signatures

* Another try

* WIP: test encoder

* Fix the deposits

* Refactoring + tests + benchmarks

* Add sp-core/runtime-benchmarks

* Remove sp-core from dev deps

* Enable full_crypto for benchmarks

* Typo

* Fix

* Update frame/nfts/src/mock.rs

Co-authored-by: Squirrel <gilescope@gmail.com>

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts

* Add docs

* Add attributes into the pre-signed object & track the deposit owner for attributes

* Update docs

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts

* Add the number of attributes provided to weights

* Apply suggestions

* Remove dead code

* Remove Copy

* Fix docs

* Update frame/nfts/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nfts/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Co-authored-by: Squirrel <gilescope@gmail.com>
Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Jegor Sidorenko
2023-02-14 10:19:50 +02:00
committed by GitHub
parent ea70fbc7a6
commit 3b767e1238
14 changed files with 1754 additions and 759 deletions
+1
View File
@@ -6017,6 +6017,7 @@ dependencies = [
"scale-info",
"sp-core",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-std",
]
+4
View File
@@ -1566,6 +1566,7 @@ impl pallet_uniques::Config for Runtime {
parameter_types! {
pub Features: PalletFeatures = PalletFeatures::all_enabled();
pub const MaxAttributesPerCall: u32 = 10;
}
impl pallet_nfts::Config for Runtime {
@@ -1586,7 +1587,10 @@ impl pallet_nfts::Config for Runtime {
type ItemAttributesApprovalsLimit = ItemAttributesApprovalsLimit;
type MaxTips = MaxTips;
type MaxDeadlineDuration = MaxDeadlineDuration;
type MaxAttributesPerCall = MaxAttributesPerCall;
type Features = Features;
type OffchainSignature = Signature;
type OffchainPublic = <Signature as traits::Verify>::Signer;
type WeightInfo = pallet_nfts::weights::SubstrateWeight<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
type Helper = ();
+3 -3
View File
@@ -21,14 +21,13 @@ frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-core = { version = "7.0.0", default-features = false, path = "../../primitives/core" }
sp-io = { version = "7.0.0", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "7.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "5.0.0", default-features = false, path = "../../primitives/std" }
[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
sp-core = { version = "7.0.0", path = "../../primitives/core" }
sp-io = { version = "7.0.0", path = "../../primitives/io" }
sp-std = { version = "5.0.0", path = "../../primitives/std" }
sp-keystore = { version = "0.13.0", path = "../../primitives/keystore" }
[features]
default = ["std"]
@@ -40,6 +39,7 @@ std = [
"log/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
+62 -6
View File
@@ -31,7 +31,11 @@ use frame_support::{
BoundedVec,
};
use frame_system::RawOrigin as SystemOrigin;
use sp_runtime::traits::{Bounded, One};
use sp_io::crypto::{sr25519_generate, sr25519_sign};
use sp_runtime::{
traits::{Bounded, IdentifyAccount, One},
AccountId32, MultiSignature, MultiSigner,
};
use sp_std::prelude::*;
use crate::Pallet as Nfts;
@@ -148,7 +152,21 @@ fn default_item_config() -> ItemConfig {
ItemConfig { settings: ItemSettings::all_enabled() }
}
fn make_filled_vec(value: u16, length: usize) -> Vec<u8> {
let mut vec = vec![0u8; length];
let mut s = Vec::from(value.to_be_bytes());
vec.truncate(length - s.len());
vec.append(&mut s);
vec
}
benchmarks_instance_pallet! {
where_clause {
where
T::OffchainSignature: From<MultiSignature>,
T::AccountId: From<AccountId32>,
}
create {
let collection = T::Helper::collection(0);
let origin = T::CreateOrigin::try_successful_origin(&collection)
@@ -439,11 +457,7 @@ benchmarks_instance_pallet! {
T::Currency::make_free_balance_be(&target, DepositBalanceOf::<T, I>::max_value());
let value: BoundedVec<_, _> = vec![0u8; T::ValueLimit::get() as usize].try_into().unwrap();
for i in 0..n {
let mut key = vec![0u8; T::KeyLimit::get() as usize];
let mut s = Vec::from((i as u16).to_be_bytes());
key.truncate(s.len());
key.append(&mut s);
let key = make_filled_vec(i as u16, T::KeyLimit::get() as usize);
Nfts::<T, I>::set_attribute(
SystemOrigin::Signed(target.clone()).into(),
T::Helper::collection(0),
@@ -717,5 +731,47 @@ benchmarks_instance_pallet! {
}.into());
}
mint_pre_signed {
let n in 0 .. T::MaxAttributesPerCall::get() as u32;
let caller_public = sr25519_generate(0.into(), None);
let caller = MultiSigner::Sr25519(caller_public).into_account().into();
T::Currency::make_free_balance_be(&caller, DepositBalanceOf::<T, I>::max_value());
let caller_lookup = T::Lookup::unlookup(caller.clone());
let collection = T::Helper::collection(0);
let item = T::Helper::item(0);
assert_ok!(Nfts::<T, I>::force_create(
SystemOrigin::Root.into(),
caller_lookup.clone(),
default_collection_config::<T, I>()
));
let metadata = vec![0u8; T::StringLimit::get() as usize];
let mut attributes = vec![];
let attribute_value = vec![0u8; T::ValueLimit::get() as usize];
for i in 0..n {
let attribute_key = make_filled_vec(i as u16, T::KeyLimit::get() as usize);
attributes.push((attribute_key, attribute_value.clone()));
}
let mint_data = PreSignedMint {
collection,
item,
attributes,
metadata: metadata.clone(),
only_account: None,
deadline: One::one(),
};
let message = Encode::encode(&mint_data);
let signature = MultiSignature::Sr25519(sr25519_sign(0.into(), &caller_public, &message).unwrap());
let target: T::AccountId = account("target", 0, SEED);
T::Currency::make_free_balance_be(&target, DepositBalanceOf::<T, I>::max_value());
frame_system::Pallet::<T>::set_block_number(One::one());
}: _(SystemOrigin::Signed(target.clone()), mint_data, signature.into(), caller)
verify {
let metadata: BoundedVec<_, _> = metadata.try_into().unwrap();
assert_last_event::<T, I>(Event::ItemMetadataSet { collection, item, data: metadata }.into());
}
impl_benchmark_test_suite!(Nfts, crate::mock::new_test_ext(), crate::mock::Test);
}
+1 -1
View File
@@ -17,7 +17,7 @@
//! Various pieces of common functionality.
use super::*;
use crate::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Get the owner of the item, if the item exists.
+56 -25
View File
@@ -26,6 +26,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
namespace: AttributeNamespace<T::AccountId>,
key: BoundedVec<u8, T::KeyLimit>,
value: BoundedVec<u8, T::ValueLimit>,
depositor: T::AccountId,
) -> DispatchResult {
ensure!(
Self::is_pallet_feature_enabled(PalletFeature::Attributes),
@@ -66,7 +67,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
}
let attribute = Attribute::<T, I>::get((collection, maybe_item, &namespace, &key));
if attribute.is_none() {
let attribute_exists = attribute.is_some();
if !attribute_exists {
collection_details.attributes.saturating_inc();
}
@@ -74,6 +76,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
attribute.map_or(AttributeDeposit { account: None, amount: Zero::zero() }, |m| m.1);
let mut deposit = Zero::zero();
// disabled DepositRequired setting only affects the CollectionOwner namespace
if collection_config.is_setting_enabled(CollectionSetting::DepositRequired) ||
namespace != AttributeNamespace::CollectionOwner
{
@@ -82,33 +85,50 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
.saturating_add(T::AttributeDepositBase::get());
}
let is_collection_owner_namespace = namespace == AttributeNamespace::CollectionOwner;
let is_depositor_collection_owner =
is_collection_owner_namespace && collection_details.owner == depositor;
// NOTE: in the CollectionOwner namespace if the depositor is `None` that means the deposit
// was paid by the collection's owner.
let old_depositor =
if is_collection_owner_namespace && old_deposit.account.is_none() && attribute_exists {
Some(collection_details.owner.clone())
} else {
old_deposit.account
};
let depositor_has_changed = old_depositor != Some(depositor.clone());
// NOTE: when we transfer an item, we don't move attributes in the ItemOwner namespace.
// When the new owner updates the same attribute, we will update the depositor record
// and return the deposit to the previous owner.
if old_deposit.account.is_some() && old_deposit.account != Some(origin.clone()) {
T::Currency::unreserve(&old_deposit.account.unwrap(), old_deposit.amount);
T::Currency::reserve(&origin, deposit)?;
if depositor_has_changed {
if let Some(old_depositor) = old_depositor {
T::Currency::unreserve(&old_depositor, old_deposit.amount);
}
T::Currency::reserve(&depositor, deposit)?;
} else if deposit > old_deposit.amount {
T::Currency::reserve(&origin, deposit - old_deposit.amount)?;
T::Currency::reserve(&depositor, deposit - old_deposit.amount)?;
} else if deposit < old_deposit.amount {
T::Currency::unreserve(&origin, old_deposit.amount - deposit);
T::Currency::unreserve(&depositor, old_deposit.amount - deposit);
}
// NOTE: we don't track the depositor in the CollectionOwner namespace as it's always a
// collection's owner. This simplifies the collection's transfer to another owner.
let deposit_owner = match namespace {
AttributeNamespace::CollectionOwner => {
collection_details.owner_deposit.saturating_accrue(deposit);
if is_depositor_collection_owner {
if !depositor_has_changed {
collection_details.owner_deposit.saturating_reduce(old_deposit.amount);
None
},
_ => Some(origin),
};
}
collection_details.owner_deposit.saturating_accrue(deposit);
}
let new_deposit_owner = match is_depositor_collection_owner {
true => None,
false => Some(depositor),
};
Attribute::<T, I>::insert(
(&collection, maybe_item, &namespace, &key),
(&value, AttributeDeposit { account: deposit_owner, amount: deposit }),
(&value, AttributeDeposit { account: new_deposit_owner, amount: deposit }),
);
Collection::<T, I>::insert(collection, &collection_details);
Self::deposit_event(Event::AttributeSet { collection, maybe_item, key, value, namespace });
Ok(())
@@ -188,10 +208,21 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
// NOTE: if the item was previously burned, the ItemConfigOf record
// might not exist. In that case, we allow to clear the attribute.
let maybe_is_locked = Self::get_item_config(&collection, &item)
.map_or(false, |c| {
c.has_disabled_setting(ItemSetting::UnlockedAttributes)
.map_or(None, |c| {
Some(c.has_disabled_setting(ItemSetting::UnlockedAttributes))
});
ensure!(!maybe_is_locked, Error::<T, I>::LockedItemAttributes);
match maybe_is_locked {
Some(is_locked) => {
// when item exists, then only the collection's owner can clear that
// attribute
ensure!(
check_owner == &collection_details.owner,
Error::<T, I>::NoPermission
);
ensure!(!is_locked, Error::<T, I>::LockedItemAttributes);
},
None => (),
}
},
},
_ => (),
@@ -199,16 +230,16 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
}
collection_details.attributes.saturating_dec();
match namespace {
AttributeNamespace::CollectionOwner => {
match deposit.account {
Some(deposit_account) => {
T::Currency::unreserve(&deposit_account, deposit.amount);
},
None if namespace == AttributeNamespace::CollectionOwner => {
collection_details.owner_deposit.saturating_reduce(deposit.amount);
T::Currency::unreserve(&collection_details.owner, deposit.amount);
},
_ => (),
};
if let Some(deposit_account) = deposit.account {
T::Currency::unreserve(&deposit_account, deposit.amount);
}
Collection::<T, I>::insert(collection, &collection_details);
@@ -85,6 +85,62 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(())
}
pub(crate) fn do_mint_pre_signed(
mint_to: T::AccountId,
mint_data: PreSignedMintOf<T, I>,
signer: T::AccountId,
) -> DispatchResult {
let PreSignedMint { collection, item, attributes, metadata, deadline, only_account } =
mint_data;
let metadata = Self::construct_metadata(metadata)?;
ensure!(
attributes.len() <= T::MaxAttributesPerCall::get() as usize,
Error::<T, I>::MaxAttributesLimitReached
);
if let Some(account) = only_account {
ensure!(account == mint_to, Error::<T, I>::WrongOrigin);
}
let now = frame_system::Pallet::<T>::block_number();
ensure!(deadline >= now, Error::<T, I>::DeadlineExpired);
let collection_details =
Collection::<T, I>::get(&collection).ok_or(Error::<T, I>::UnknownCollection)?;
ensure!(collection_details.owner == signer, Error::<T, I>::NoPermission);
let item_config = ItemConfig { settings: Self::get_default_item_settings(&collection)? };
Self::do_mint(
collection,
item,
Some(mint_to.clone()),
mint_to.clone(),
item_config,
|_, _| Ok(()),
)?;
for (key, value) in attributes {
Self::do_set_attribute(
collection_details.owner.clone(),
collection,
Some(item),
AttributeNamespace::CollectionOwner,
Self::construct_attribute_key(key)?,
Self::construct_attribute_value(value)?,
mint_to.clone(),
)?;
}
if !metadata.len().is_zero() {
Self::do_set_item_metadata(
Some(collection_details.owner.clone()),
collection,
item,
metadata,
Some(mint_to.clone()),
)?;
}
Ok(())
}
pub fn do_burn(
collection: T::CollectionId,
item: T::ItemId,
+15 -6
View File
@@ -60,14 +60,16 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
.saturating_add(T::MetadataDepositBase::get());
}
// the previous deposit was taken from the item's owner
if old_deposit.account.is_some() && maybe_depositor.is_none() {
T::Currency::unreserve(&old_deposit.account.unwrap(), old_deposit.amount);
T::Currency::reserve(&collection_details.owner, deposit)?;
let depositor = maybe_depositor.clone().unwrap_or(collection_details.owner.clone());
let old_depositor = old_deposit.account.unwrap_or(collection_details.owner.clone());
if depositor != old_depositor {
T::Currency::unreserve(&old_depositor, old_deposit.amount);
T::Currency::reserve(&depositor, deposit)?;
} else if deposit > old_deposit.amount {
T::Currency::reserve(&collection_details.owner, deposit - old_deposit.amount)?;
T::Currency::reserve(&depositor, deposit - old_deposit.amount)?;
} else if deposit < old_deposit.amount {
T::Currency::unreserve(&collection_details.owner, old_deposit.amount - deposit);
T::Currency::unreserve(&depositor, old_deposit.amount - deposit);
}
if maybe_depositor.is_none() {
@@ -191,4 +193,11 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(())
})
}
/// A helper method to construct metadata.
pub fn construct_metadata(
metadata: Vec<u8>,
) -> Result<BoundedVec<u8, T::StringLimit>, DispatchError> {
Ok(BoundedVec::try_from(metadata).map_err(|_| Error::<T, I>::IncorrectMetadata)?)
}
}
@@ -96,6 +96,13 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(config)
}
pub(crate) fn get_default_item_settings(
collection_id: &T::CollectionId,
) -> Result<ItemSettings, DispatchError> {
let collection_config = Self::get_collection_config(collection_id)?;
Ok(collection_config.mint_settings.default_item_settings)
}
pub(crate) fn is_pallet_feature_enabled(feature: PalletFeature) -> bool {
let features = T::Features::get();
return features.is_enabled(feature)
+61 -5
View File
@@ -67,6 +67,7 @@ pub mod pallet {
use super::*;
use frame_support::{pallet_prelude::*, traits::ExistenceRequirement};
use frame_system::pallet_prelude::*;
use sp_runtime::traits::{IdentifyAccount, Verify};
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
@@ -167,10 +168,24 @@ pub mod pallet {
#[pallet::constant]
type MaxDeadlineDuration: Get<<Self as SystemConfig>::BlockNumber>;
/// The max number of attributes a user could set per call.
#[pallet::constant]
type MaxAttributesPerCall: Get<u32>;
/// Disables some of pallet's features.
#[pallet::constant]
type Features: Get<PalletFeatures>;
/// Off-Chain signature type.
///
/// Can verify whether an `Self::OffchainPublic` created a signature.
type OffchainSignature: Verify<Signer = Self::OffchainPublic> + Parameter;
/// Off-Chain public key.
///
/// Must identify as an on-chain `Self::AccountId`.
type OffchainPublic: IdentifyAccount<AccountId = Self::AccountId>;
#[cfg(feature = "runtime-benchmarks")]
/// A set of helper functions for benchmarking.
type Helper: BenchmarkHelper<Self::CollectionId, Self::ItemId>;
@@ -591,6 +606,14 @@ pub mod pallet {
AlreadyClaimed,
/// The provided data is incorrect.
IncorrectData,
/// The extrinsic was sent by the wrong origin.
WrongOrigin,
/// The provided signature is incorrect.
WrongSignature,
/// The provided metadata might be too long.
IncorrectMetadata,
/// Can't set more attributes per one call.
MaxAttributesLimitReached,
}
#[pallet::call]
@@ -742,10 +765,8 @@ pub mod pallet {
) -> DispatchResult {
let caller = ensure_signed(origin)?;
let mint_to = T::Lookup::lookup(mint_to)?;
let collection_config = Self::get_collection_config(&collection)?;
let item_settings = collection_config.mint_settings.default_item_settings;
let item_config = ItemConfig { settings: item_settings };
let item_config =
ItemConfig { settings: Self::get_default_item_settings(&collection)? };
Self::do_mint(
collection,
@@ -1325,7 +1346,15 @@ pub mod pallet {
value: BoundedVec<u8, T::ValueLimit>,
) -> DispatchResult {
let origin = ensure_signed(origin)?;
Self::do_set_attribute(origin, collection, maybe_item, namespace, key, value)
Self::do_set_attribute(
origin.clone(),
collection,
maybe_item,
namespace,
key,
value,
origin,
)
}
/// Force-set an attribute for a collection or item.
@@ -1768,6 +1797,33 @@ pub mod pallet {
witness_price,
)
}
/// Mint an item by providing the pre-signed approval.
///
/// Origin must be Signed.
///
/// - `mint_data`: The pre-signed approval that consists of the information about the item,
/// its metadata, attributes, who can mint it (`None` for anyone) and until what block
/// number.
/// - `signature`: The signature of the `data` object.
/// - `signer`: The `data` object's signer. Should be an owner of the collection.
///
/// Emits `Issued` on success.
/// Emits `AttributeSet` if the attributes were provided.
/// Emits `ItemMetadataSet` if the metadata was not empty.
#[pallet::call_index(37)]
#[pallet::weight(T::WeightInfo::mint_pre_signed(mint_data.attributes.len() as u32))]
pub fn mint_pre_signed(
origin: OriginFor<T>,
mint_data: PreSignedMintOf<T, I>,
signature: T::OffchainSignature,
signer: T::AccountId,
) -> DispatchResult {
let origin = ensure_signed(origin)?;
let msg = Encode::encode(&mint_data);
ensure!(signature.verify(&*msg, &signer), Error::<T, I>::WrongSignature);
Self::do_mint_pre_signed(origin, mint_data, signer)
}
}
}
+19 -4
View File
@@ -25,10 +25,13 @@ use frame_support::{
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64},
};
use sp_core::H256;
use sp_keystore::{testing::KeyStore, KeystoreExt};
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify},
MultiSignature,
};
use std::sync::Arc;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
@@ -45,6 +48,10 @@ construct_runtime!(
}
);
pub type Signature = MultiSignature;
pub type AccountPublic = <Signature as Verify>::Signer;
pub type AccountId = <AccountPublic as IdentifyAccount>::AccountId;
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -55,7 +62,7 @@ impl frame_system::Config for Test {
type BlockNumber = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = u64;
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
@@ -93,8 +100,8 @@ impl Config for Test {
type CollectionId = u32;
type ItemId = u32;
type Currency = Balances;
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<u64>>;
type ForceOrigin = frame_system::EnsureRoot<u64>;
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<Self::AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Locker = ();
type CollectionDeposit = ConstU64<2>;
type ItemDeposit = ConstU64<1>;
@@ -108,7 +115,13 @@ impl Config for Test {
type ItemAttributesApprovalsLimit = ConstU32<2>;
type MaxTips = ConstU32<10>;
type MaxDeadlineDuration = ConstU64<10000>;
type MaxAttributesPerCall = ConstU32<2>;
type Features = Features;
/// Off-chain = signature On-chain - therefore no conversion needed.
/// It needs to be From<MultiSignature> for benchmarking.
type OffchainSignature = Signature;
/// Using `AccountPublic` here makes it trivial to convert to `AccountId` via `into_account()`.
type OffchainPublic = AccountPublic;
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type Helper = ();
@@ -117,7 +130,9 @@ impl Config for Test {
pub(crate) fn new_test_ext() -> sp_io::TestExternalities {
let t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
let keystore = KeyStore::new();
let mut ext = sp_io::TestExternalities::new(t);
ext.register_extension(KeystoreExt(Arc::new(keystore)));
ext.execute_with(|| System::set_block_number(1));
ext
}
File diff suppressed because it is too large Load Diff
+23 -1
View File
@@ -61,6 +61,12 @@ pub(super) type CollectionConfigFor<T, I = ()> = CollectionConfig<
<T as SystemConfig>::BlockNumber,
<T as Config<I>>::CollectionId,
>;
pub(super) type PreSignedMintOf<T, I = ()> = PreSignedMint<
<T as Config<I>>::CollectionId,
<T as Config<I>>::ItemId,
<T as SystemConfig>::AccountId,
<T as SystemConfig>::BlockNumber,
>;
pub trait Incrementable {
fn increment(&self) -> Self;
@@ -187,7 +193,7 @@ pub struct PendingSwap<CollectionId, ItemId, ItemPriceWithDirection, Deadline> {
pub(super) desired_item: Option<ItemId>,
/// A price for the desired `item` with the direction.
pub(super) price: Option<ItemPriceWithDirection>,
/// An optional deadline for the swap.
/// A deadline for the swap.
pub(super) deadline: Deadline,
}
@@ -473,3 +479,19 @@ impl CollectionRoles {
}
}
impl_codec_bitflags!(CollectionRoles, u8, CollectionRole);
#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct PreSignedMint<CollectionId, ItemId, AccountId, Deadline> {
/// A collection of the item to be minted.
pub(super) collection: CollectionId,
/// Item's id.
pub(super) item: ItemId,
/// Additional item's key-value attributes.
pub(super) attributes: Vec<(Vec<u8>, Vec<u8>)>,
/// Additional item's metadata.
pub(super) metadata: Vec<u8>,
/// Restrict the claim to a particular account.
pub(super) only_account: Option<AccountId>,
/// A deadline for the signature.
pub(super) deadline: Deadline,
}
+242 -182
View File
@@ -18,25 +18,26 @@
//! Autogenerated weights for pallet_nfts
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-01-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `runner-b3zmxxc-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/substrate
// target/production/substrate
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_nfts
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/nfts/src/weights.rs
// --json-file=/builds/parity/mirrors/substrate/.git/.artifacts/bench.json
// --pallet=pallet_nfts
// --chain=dev
// --header=./HEADER-APACHE2
// --output=./frame/nfts/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
#![cfg_attr(rustfmt, rustfmt_skip)]
@@ -85,6 +86,7 @@ pub trait WeightInfo {
fn create_swap() -> Weight;
fn cancel_swap() -> Weight;
fn claim_swap() -> Weight;
fn mint_pre_signed(n: u32, ) -> Weight;
}
/// Weights for pallet_nfts using the Substrate node and recommended hardware.
@@ -104,8 +106,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `214`
// Estimated: `3054`
// Minimum execution time: 32_467 nanoseconds.
Weight::from_parts(33_236_000, 3054)
// Minimum execution time: 33_666 nanoseconds.
Weight::from_parts(34_405_000, 3054)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
@@ -123,8 +125,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3054`
// Minimum execution time: 22_198 nanoseconds.
Weight::from_parts(22_776_000, 3054)
// Minimum execution time: 22_028 nanoseconds.
Weight::from_parts(23_030_000, 3054)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
@@ -151,18 +153,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// The range of component `n` is `[0, 1000]`.
/// The range of component `m` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy(n: u32, m: u32, a: u32, ) -> Weight {
fn destroy(_n: u32, m: u32, a: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `172781 + m * (127 ±0) + a * (402 ±0)`
// Estimated: `3347427 + a * (2921 ±0) + m * (2615 ±0)`
// Minimum execution time: 24_021_657 nanoseconds.
Weight::from_parts(16_029_391_606, 3347427)
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(300_580).saturating_mul(n.into()))
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(7_748_502).saturating_mul(m.into()))
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(9_183_566).saturating_mul(a.into()))
// Minimum execution time: 27_944_985 nanoseconds.
Weight::from_parts(19_865_318_850, 3347427)
// Standard Error: 32_345
.saturating_add(Weight::from_ref_time(8_729_316).saturating_mul(m.into()))
// Standard Error: 32_345
.saturating_add(Weight::from_ref_time(10_264_491).saturating_mul(a.into()))
.saturating_add(T::DbWeight::get().reads(1004_u64))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into())))
@@ -188,8 +188,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `448`
// Estimated: `13506`
// Minimum execution time: 42_634 nanoseconds.
Weight::from_parts(43_231_000, 13506)
// Minimum execution time: 43_925 nanoseconds.
Weight::from_parts(45_885_000, 13506)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
@@ -209,8 +209,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `448`
// Estimated: `13506`
// Minimum execution time: 41_686 nanoseconds.
Weight::from_parts(41_991_000, 13506)
// Minimum execution time: 42_832 nanoseconds.
Weight::from_parts(44_621_000, 13506)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
@@ -236,8 +236,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `647`
// Estimated: `13573`
// Minimum execution time: 45_192 nanoseconds.
Weight::from_parts(45_792_000, 13573)
// Minimum execution time: 47_787 nanoseconds.
Weight::from_parts(49_204_000, 13573)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(7_u64))
}
@@ -263,8 +263,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `882`
// Estimated: `16109`
// Minimum execution time: 51_962 nanoseconds.
Weight::from_parts(52_367_000, 16109)
// Minimum execution time: 55_524 nanoseconds.
Weight::from_parts(56_962_000, 16109)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
@@ -279,10 +279,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `756 + i * (140 ±0)`
// Estimated: `5103 + i * (3336 ±0)`
// Minimum execution time: 15_512 nanoseconds.
Weight::from_parts(15_731_000, 5103)
// Standard Error: 9_495
.saturating_add(Weight::from_ref_time(11_462_413).saturating_mul(i.into()))
// Minimum execution time: 15_246 nanoseconds.
Weight::from_parts(15_671_000, 5103)
// Standard Error: 20_348
.saturating_add(Weight::from_ref_time(14_692_422).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())))
@@ -296,8 +296,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `401`
// Estimated: `5067`
// Minimum execution time: 19_273 nanoseconds.
Weight::from_parts(19_508_000, 5067)
// Minimum execution time: 19_270 nanoseconds.
Weight::from_parts(19_775_000, 5067)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -309,8 +309,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `401`
// Estimated: `5067`
// Minimum execution time: 19_022 nanoseconds.
Weight::from_parts(19_430_000, 5067)
// Minimum execution time: 19_364 nanoseconds.
Weight::from_parts(20_274_000, 5067)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -322,8 +322,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `289`
// Estimated: `5092`
// Minimum execution time: 17_593 nanoseconds.
Weight::from_parts(17_950_000, 5092)
// Minimum execution time: 17_036 nanoseconds.
Weight::from_parts(17_750_000, 5092)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -337,8 +337,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `381`
// Estimated: `5082`
// Minimum execution time: 22_068 nanoseconds.
Weight::from_parts(22_235_000, 5082)
// Minimum execution time: 22_104 nanoseconds.
Weight::from_parts(23_022_000, 5082)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
@@ -350,8 +350,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `362`
// Estimated: `2555`
// Minimum execution time: 25_056 nanoseconds.
Weight::from_parts(25_767_000, 2555)
// Minimum execution time: 24_516 nanoseconds.
Weight::from_parts(25_300_000, 2555)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
@@ -363,8 +363,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `304`
// Estimated: `2555`
// Minimum execution time: 17_398 nanoseconds.
Weight::from_parts(17_684_000, 2555)
// Minimum execution time: 16_974 nanoseconds.
Weight::from_parts(17_654_000, 2555)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
@@ -376,8 +376,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `242`
// Estimated: `2555`
// Minimum execution time: 14_054 nanoseconds.
Weight::from_parts(14_243_000, 2555)
// Minimum execution time: 13_190 nanoseconds.
Weight::from_parts(13_826_000, 2555)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -389,8 +389,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `445`
// Estimated: `5078`
// Minimum execution time: 17_662 nanoseconds.
Weight::from_parts(18_073_000, 5078)
// Minimum execution time: 17_336 nanoseconds.
Weight::from_parts(18_242_000, 5078)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -406,8 +406,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `10547`
// Minimum execution time: 40_098 nanoseconds.
Weight::from_parts(40_649_000, 10547)
// Minimum execution time: 40_791 nanoseconds.
Weight::from_parts(42_489_000, 10547)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -419,8 +419,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `337`
// Estimated: `5476`
// Minimum execution time: 25_178 nanoseconds.
Weight::from_parts(25_473_000, 5476)
// Minimum execution time: 24_620 nanoseconds.
Weight::from_parts(25_370_000, 5476)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -434,8 +434,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `916`
// Estimated: `7999`
// Minimum execution time: 35_202 nanoseconds.
Weight::from_parts(35_518_000, 7999)
// Minimum execution time: 36_411 nanoseconds.
Weight::from_parts(37_439_000, 7999)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -447,8 +447,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `379`
// Estimated: `6492`
// Minimum execution time: 17_260 nanoseconds.
Weight::from_parts(17_498_000, 6492)
// Minimum execution time: 16_696 nanoseconds.
Weight::from_parts(17_411_000, 6492)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -463,12 +463,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// The range of component `n` is `[0, 1000]`.
fn cancel_item_attributes_approval(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `865 + n * (367 ±0)`
// Measured: `899 + n * (396 ±0)`
// Estimated: `12016 + n * (2921 ±0)`
// Minimum execution time: 25_579 nanoseconds.
Weight::from_parts(25_846_000, 12016)
// Standard Error: 7_759
.saturating_add(Weight::from_ref_time(7_159_200).saturating_mul(n.into()))
// Minimum execution time: 25_928 nanoseconds.
Weight::from_parts(26_440_000, 12016)
// Standard Error: 9_158
.saturating_add(Weight::from_ref_time(9_271_441).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))
@@ -487,8 +487,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `10241`
// Minimum execution time: 33_285 nanoseconds.
Weight::from_parts(33_692_000, 10241)
// Minimum execution time: 34_150 nanoseconds.
Weight::from_parts(35_398_000, 10241)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -502,8 +502,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `609`
// Estimated: `7693`
// Minimum execution time: 30_670 nanoseconds.
Weight::from_parts(31_282_000, 7693)
// Minimum execution time: 31_871 nanoseconds.
Weight::from_parts(33_057_000, 7693)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -517,8 +517,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `7665`
// Minimum execution time: 28_313 nanoseconds.
Weight::from_parts(28_724_000, 7665)
// Minimum execution time: 28_843 nanoseconds.
Weight::from_parts(30_057_000, 7665)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -532,8 +532,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `476`
// Estimated: `7665`
// Minimum execution time: 27_034 nanoseconds.
Weight::from_parts(27_655_000, 7665)
// Minimum execution time: 27_777 nanoseconds.
Weight::from_parts(28_471_000, 7665)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -547,8 +547,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `466`
// Estimated: `8428`
// Minimum execution time: 23_408 nanoseconds.
Weight::from_parts(23_916_000, 8428)
// Minimum execution time: 23_726 nanoseconds.
Weight::from_parts(24_455_000, 8428)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -560,8 +560,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `5880`
// Minimum execution time: 21_177 nanoseconds.
Weight::from_parts(21_492_000, 5880)
// Minimum execution time: 21_051 nanoseconds.
Weight::from_parts(21_722_000, 5880)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -573,8 +573,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `5880`
// Minimum execution time: 20_279 nanoseconds.
Weight::from_parts(20_919_000, 5880)
// Minimum execution time: 20_095 nanoseconds.
Weight::from_parts(20_770_000, 5880)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -584,8 +584,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `2527`
// Minimum execution time: 14_921 nanoseconds.
Weight::from_parts(15_382_000, 2527)
// Minimum execution time: 14_078 nanoseconds.
Weight::from_parts(14_582_000, 2527)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -597,8 +597,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `5103`
// Minimum execution time: 18_201 nanoseconds.
Weight::from_parts(18_628_000, 5103)
// Minimum execution time: 17_677 nanoseconds.
Weight::from_parts(18_381_000, 5103)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -610,8 +610,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `5103`
// Minimum execution time: 16_870 nanoseconds.
Weight::from_parts(17_318_000, 5103)
// Minimum execution time: 16_295 nanoseconds.
Weight::from_parts(17_036_000, 5103)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -627,8 +627,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `516`
// Estimated: `8407`
// Minimum execution time: 22_604 nanoseconds.
Weight::from_parts(22_867_000, 8407)
// Minimum execution time: 22_847 nanoseconds.
Weight::from_parts(23_536_000, 8407)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -652,8 +652,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `934`
// Estimated: `16129`
// Minimum execution time: 56_849 nanoseconds.
Weight::from_parts(57_336_000, 16129)
// Minimum execution time: 60_517 nanoseconds.
Weight::from_parts(62_528_000, 16129)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
@@ -662,10 +662,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_308 nanoseconds.
Weight::from_ref_time(4_805_401)
// Standard Error: 13_875
.saturating_add(Weight::from_ref_time(3_167_190).saturating_mul(n.into()))
// Minimum execution time: 1_866 nanoseconds.
Weight::from_ref_time(3_949_301)
// Standard Error: 11_044
.saturating_add(Weight::from_ref_time(3_424_466).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)
@@ -675,8 +675,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `524`
// Estimated: `6672`
// Minimum execution time: 20_395 nanoseconds.
Weight::from_parts(20_716_000, 6672)
// Minimum execution time: 21_174 nanoseconds.
Weight::from_parts(21_619_000, 6672)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -688,8 +688,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `511`
// Estimated: `5882`
// Minimum execution time: 19_936 nanoseconds.
Weight::from_parts(20_344_000, 5882)
// Minimum execution time: 20_606 nanoseconds.
Weight::from_parts(21_150_000, 5882)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -713,11 +713,42 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `1097`
// Estimated: `21970`
// Minimum execution time: 80_884 nanoseconds.
Weight::from_parts(81_643_000, 21970)
// Minimum execution time: 88_414 nanoseconds.
Weight::from_parts(91_830_000, 21970)
.saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(11_u64))
}
/// Storage: Nfts Collection (r:1 w:1)
/// Proof: Nfts Collection (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
/// Storage: Nfts CollectionConfigOf (r:1 w:0)
/// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
/// Storage: Nfts Item (r:1 w:1)
/// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen)
/// Storage: Nfts ItemConfigOf (r:1 w:1)
/// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Nfts Attribute (r:10 w:10)
/// Proof: Nfts Attribute (max_values: None, max_size: Some(446), added: 2921, mode: MaxEncodedLen)
/// Storage: Nfts ItemMetadataOf (r:1 w:1)
/// Proof: Nfts ItemMetadataOf (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen)
/// Storage: Nfts Account (r:0 w:1)
/// Proof: Nfts Account (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 10]`.
fn mint_pre_signed(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `596`
// Estimated: `16180 + n * (2921 ±0)`
// Minimum execution time: 124_354 nanoseconds.
Weight::from_parts(133_779_491, 16180)
// Standard Error: 38_452
.saturating_add(Weight::from_ref_time(25_110_697).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes(6_u64))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2921).saturating_mul(n.into()))
}
}
// For backwards compatibility and tests
@@ -736,8 +767,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `214`
// Estimated: `3054`
// Minimum execution time: 32_467 nanoseconds.
Weight::from_parts(33_236_000, 3054)
// Minimum execution time: 33_666 nanoseconds.
Weight::from_parts(34_405_000, 3054)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
@@ -755,8 +786,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3054`
// Minimum execution time: 22_198 nanoseconds.
Weight::from_parts(22_776_000, 3054)
// Minimum execution time: 22_028 nanoseconds.
Weight::from_parts(23_030_000, 3054)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
@@ -783,18 +814,16 @@ impl WeightInfo for () {
/// The range of component `n` is `[0, 1000]`.
/// The range of component `m` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy(n: u32, m: u32, a: u32, ) -> Weight {
fn destroy(_n: u32, m: u32, a: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `172781 + m * (127 ±0) + a * (402 ±0)`
// Estimated: `3347427 + a * (2921 ±0) + m * (2615 ±0)`
// Minimum execution time: 24_021_657 nanoseconds.
Weight::from_parts(16_029_391_606, 3347427)
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(300_580).saturating_mul(n.into()))
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(7_748_502).saturating_mul(m.into()))
// Standard Error: 20_364
.saturating_add(Weight::from_ref_time(9_183_566).saturating_mul(a.into()))
// Minimum execution time: 27_944_985 nanoseconds.
Weight::from_parts(19_865_318_850, 3347427)
// Standard Error: 32_345
.saturating_add(Weight::from_ref_time(8_729_316).saturating_mul(m.into()))
// Standard Error: 32_345
.saturating_add(Weight::from_ref_time(10_264_491).saturating_mul(a.into()))
.saturating_add(RocksDbWeight::get().reads(1004_u64))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into())))
@@ -820,8 +849,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `448`
// Estimated: `13506`
// Minimum execution time: 42_634 nanoseconds.
Weight::from_parts(43_231_000, 13506)
// Minimum execution time: 43_925 nanoseconds.
Weight::from_parts(45_885_000, 13506)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
@@ -841,8 +870,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `448`
// Estimated: `13506`
// Minimum execution time: 41_686 nanoseconds.
Weight::from_parts(41_991_000, 13506)
// Minimum execution time: 42_832 nanoseconds.
Weight::from_parts(44_621_000, 13506)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
@@ -868,8 +897,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `647`
// Estimated: `13573`
// Minimum execution time: 45_192 nanoseconds.
Weight::from_parts(45_792_000, 13573)
// Minimum execution time: 47_787 nanoseconds.
Weight::from_parts(49_204_000, 13573)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(7_u64))
}
@@ -895,8 +924,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `882`
// Estimated: `16109`
// Minimum execution time: 51_962 nanoseconds.
Weight::from_parts(52_367_000, 16109)
// Minimum execution time: 55_524 nanoseconds.
Weight::from_parts(56_962_000, 16109)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
@@ -911,10 +940,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `756 + i * (140 ±0)`
// Estimated: `5103 + i * (3336 ±0)`
// Minimum execution time: 15_512 nanoseconds.
Weight::from_parts(15_731_000, 5103)
// Standard Error: 9_495
.saturating_add(Weight::from_ref_time(11_462_413).saturating_mul(i.into()))
// Minimum execution time: 15_246 nanoseconds.
Weight::from_parts(15_671_000, 5103)
// Standard Error: 20_348
.saturating_add(Weight::from_ref_time(14_692_422).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())))
@@ -928,8 +957,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `401`
// Estimated: `5067`
// Minimum execution time: 19_273 nanoseconds.
Weight::from_parts(19_508_000, 5067)
// Minimum execution time: 19_270 nanoseconds.
Weight::from_parts(19_775_000, 5067)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -941,8 +970,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `401`
// Estimated: `5067`
// Minimum execution time: 19_022 nanoseconds.
Weight::from_parts(19_430_000, 5067)
// Minimum execution time: 19_364 nanoseconds.
Weight::from_parts(20_274_000, 5067)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -954,8 +983,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `289`
// Estimated: `5092`
// Minimum execution time: 17_593 nanoseconds.
Weight::from_parts(17_950_000, 5092)
// Minimum execution time: 17_036 nanoseconds.
Weight::from_parts(17_750_000, 5092)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -969,8 +998,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `381`
// Estimated: `5082`
// Minimum execution time: 22_068 nanoseconds.
Weight::from_parts(22_235_000, 5082)
// Minimum execution time: 22_104 nanoseconds.
Weight::from_parts(23_022_000, 5082)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
@@ -982,8 +1011,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `362`
// Estimated: `2555`
// Minimum execution time: 25_056 nanoseconds.
Weight::from_parts(25_767_000, 2555)
// Minimum execution time: 24_516 nanoseconds.
Weight::from_parts(25_300_000, 2555)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
@@ -995,8 +1024,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `304`
// Estimated: `2555`
// Minimum execution time: 17_398 nanoseconds.
Weight::from_parts(17_684_000, 2555)
// Minimum execution time: 16_974 nanoseconds.
Weight::from_parts(17_654_000, 2555)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
@@ -1008,8 +1037,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `242`
// Estimated: `2555`
// Minimum execution time: 14_054 nanoseconds.
Weight::from_parts(14_243_000, 2555)
// Minimum execution time: 13_190 nanoseconds.
Weight::from_parts(13_826_000, 2555)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1021,8 +1050,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `445`
// Estimated: `5078`
// Minimum execution time: 17_662 nanoseconds.
Weight::from_parts(18_073_000, 5078)
// Minimum execution time: 17_336 nanoseconds.
Weight::from_parts(18_242_000, 5078)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1038,8 +1067,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `10547`
// Minimum execution time: 40_098 nanoseconds.
Weight::from_parts(40_649_000, 10547)
// Minimum execution time: 40_791 nanoseconds.
Weight::from_parts(42_489_000, 10547)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1051,8 +1080,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `337`
// Estimated: `5476`
// Minimum execution time: 25_178 nanoseconds.
Weight::from_parts(25_473_000, 5476)
// Minimum execution time: 24_620 nanoseconds.
Weight::from_parts(25_370_000, 5476)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1066,8 +1095,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `916`
// Estimated: `7999`
// Minimum execution time: 35_202 nanoseconds.
Weight::from_parts(35_518_000, 7999)
// Minimum execution time: 36_411 nanoseconds.
Weight::from_parts(37_439_000, 7999)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1079,8 +1108,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `379`
// Estimated: `6492`
// Minimum execution time: 17_260 nanoseconds.
Weight::from_parts(17_498_000, 6492)
// Minimum execution time: 16_696 nanoseconds.
Weight::from_parts(17_411_000, 6492)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1095,12 +1124,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: `865 + n * (367 ±0)`
// Measured: `899 + n * (396 ±0)`
// Estimated: `12016 + n * (2921 ±0)`
// Minimum execution time: 25_579 nanoseconds.
Weight::from_parts(25_846_000, 12016)
// Standard Error: 7_759
.saturating_add(Weight::from_ref_time(7_159_200).saturating_mul(n.into()))
// Minimum execution time: 25_928 nanoseconds.
Weight::from_parts(26_440_000, 12016)
// Standard Error: 9_158
.saturating_add(Weight::from_ref_time(9_271_441).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))
@@ -1119,8 +1148,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `10241`
// Minimum execution time: 33_285 nanoseconds.
Weight::from_parts(33_692_000, 10241)
// Minimum execution time: 34_150 nanoseconds.
Weight::from_parts(35_398_000, 10241)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1134,8 +1163,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `609`
// Estimated: `7693`
// Minimum execution time: 30_670 nanoseconds.
Weight::from_parts(31_282_000, 7693)
// Minimum execution time: 31_871 nanoseconds.
Weight::from_parts(33_057_000, 7693)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1149,8 +1178,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `7665`
// Minimum execution time: 28_313 nanoseconds.
Weight::from_parts(28_724_000, 7665)
// Minimum execution time: 28_843 nanoseconds.
Weight::from_parts(30_057_000, 7665)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -1164,8 +1193,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `476`
// Estimated: `7665`
// Minimum execution time: 27_034 nanoseconds.
Weight::from_parts(27_655_000, 7665)
// Minimum execution time: 27_777 nanoseconds.
Weight::from_parts(28_471_000, 7665)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1179,8 +1208,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `466`
// Estimated: `8428`
// Minimum execution time: 23_408 nanoseconds.
Weight::from_parts(23_916_000, 8428)
// Minimum execution time: 23_726 nanoseconds.
Weight::from_parts(24_455_000, 8428)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1192,8 +1221,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `5880`
// Minimum execution time: 21_177 nanoseconds.
Weight::from_parts(21_492_000, 5880)
// Minimum execution time: 21_051 nanoseconds.
Weight::from_parts(21_722_000, 5880)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1205,8 +1234,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `474`
// Estimated: `5880`
// Minimum execution time: 20_279 nanoseconds.
Weight::from_parts(20_919_000, 5880)
// Minimum execution time: 20_095 nanoseconds.
Weight::from_parts(20_770_000, 5880)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1216,8 +1245,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `2527`
// Minimum execution time: 14_921 nanoseconds.
Weight::from_parts(15_382_000, 2527)
// Minimum execution time: 14_078 nanoseconds.
Weight::from_parts(14_582_000, 2527)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1229,8 +1258,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `5103`
// Minimum execution time: 18_201 nanoseconds.
Weight::from_parts(18_628_000, 5103)
// Minimum execution time: 17_677 nanoseconds.
Weight::from_parts(18_381_000, 5103)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1242,8 +1271,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `333`
// Estimated: `5103`
// Minimum execution time: 16_870 nanoseconds.
Weight::from_parts(17_318_000, 5103)
// Minimum execution time: 16_295 nanoseconds.
Weight::from_parts(17_036_000, 5103)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1259,8 +1288,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `516`
// Estimated: `8407`
// Minimum execution time: 22_604 nanoseconds.
Weight::from_parts(22_867_000, 8407)
// Minimum execution time: 22_847 nanoseconds.
Weight::from_parts(23_536_000, 8407)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1284,8 +1313,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `934`
// Estimated: `16129`
// Minimum execution time: 56_849 nanoseconds.
Weight::from_parts(57_336_000, 16129)
// Minimum execution time: 60_517 nanoseconds.
Weight::from_parts(62_528_000, 16129)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
@@ -1294,10 +1323,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_308 nanoseconds.
Weight::from_ref_time(4_805_401)
// Standard Error: 13_875
.saturating_add(Weight::from_ref_time(3_167_190).saturating_mul(n.into()))
// Minimum execution time: 1_866 nanoseconds.
Weight::from_ref_time(3_949_301)
// Standard Error: 11_044
.saturating_add(Weight::from_ref_time(3_424_466).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)
@@ -1307,8 +1336,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `524`
// Estimated: `6672`
// Minimum execution time: 20_395 nanoseconds.
Weight::from_parts(20_716_000, 6672)
// Minimum execution time: 21_174 nanoseconds.
Weight::from_parts(21_619_000, 6672)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1320,8 +1349,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `511`
// Estimated: `5882`
// Minimum execution time: 19_936 nanoseconds.
Weight::from_parts(20_344_000, 5882)
// Minimum execution time: 20_606 nanoseconds.
Weight::from_parts(21_150_000, 5882)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -1345,9 +1374,40 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `1097`
// Estimated: `21970`
// Minimum execution time: 80_884 nanoseconds.
Weight::from_parts(81_643_000, 21970)
// Minimum execution time: 88_414 nanoseconds.
Weight::from_parts(91_830_000, 21970)
.saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(11_u64))
}
/// Storage: Nfts Collection (r:1 w:1)
/// Proof: Nfts Collection (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
/// Storage: Nfts CollectionConfigOf (r:1 w:0)
/// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
/// Storage: Nfts Item (r:1 w:1)
/// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen)
/// Storage: Nfts ItemConfigOf (r:1 w:1)
/// Proof: Nfts ItemConfigOf (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Nfts Attribute (r:10 w:10)
/// Proof: Nfts Attribute (max_values: None, max_size: Some(446), added: 2921, mode: MaxEncodedLen)
/// Storage: Nfts ItemMetadataOf (r:1 w:1)
/// Proof: Nfts ItemMetadataOf (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen)
/// Storage: Nfts Account (r:0 w:1)
/// Proof: Nfts Account (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 10]`.
fn mint_pre_signed(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `596`
// Estimated: `16180 + n * (2921 ±0)`
// Minimum execution time: 124_354 nanoseconds.
Weight::from_parts(133_779_491, 16180)
// Standard Error: 38_452
.saturating_add(Weight::from_ref_time(25_110_697).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(RocksDbWeight::get().writes(6_u64))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2921).saturating_mul(n.into()))
}
}