From 382484f2b800c857aca0ed4e745fb20adf598be4 Mon Sep 17 00:00:00 2001 From: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> Date: Wed, 22 Feb 2023 15:50:40 +0200 Subject: [PATCH] [NFTs] Update attributes with offchain signature (#13390) * 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 * ".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 * Support pre-signed attributes * Update docs * Fix merge artifacts * Update docs * Add more tests * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Update frame/nfts/src/types.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update types.rs --------- Co-authored-by: Squirrel Co-authored-by: command-bot <> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> --- frame/nfts/src/benchmarking.rs | 50 +++ frame/nfts/src/features/attributes.rs | 53 +++ frame/nfts/src/lib.rs | 35 ++ frame/nfts/src/tests.rs | 308 ++++++++++++++++ frame/nfts/src/types.rs | 22 +- frame/nfts/src/weights.rs | 497 ++++++++++++++++---------- 6 files changed, 782 insertions(+), 183 deletions(-) diff --git a/frame/nfts/src/benchmarking.rs b/frame/nfts/src/benchmarking.rs index efa0a7412ce16..ae628fbefcce6 100644 --- a/frame/nfts/src/benchmarking.rs +++ b/frame/nfts/src/benchmarking.rs @@ -773,5 +773,55 @@ benchmarks_instance_pallet! { assert_last_event::(Event::ItemMetadataSet { collection, item, data: metadata }.into()); } + set_attributes_pre_signed { + let n in 0 .. T::MaxAttributesPerCall::get() as u32; + let (collection, _, _) = create_collection::(); + + let item_owner: T::AccountId = account("item_owner", 0, SEED); + let item_owner_lookup = T::Lookup::unlookup(item_owner.clone()); + + let signer_public = sr25519_generate(0.into(), None); + let signer: T::AccountId = MultiSigner::Sr25519(signer_public).into_account().into(); + + T::Currency::make_free_balance_be(&item_owner, DepositBalanceOf::::max_value()); + + let item = T::Helper::item(0); + assert_ok!(Nfts::::force_mint( + SystemOrigin::Root.into(), + collection, + item, + item_owner_lookup.clone(), + default_item_config(), + )); + + 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 pre_signed_data = PreSignedAttributes { + collection, + item, + attributes, + namespace: AttributeNamespace::Account(signer.clone()), + deadline: One::one(), + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(sr25519_sign(0.into(), &signer_public, &message).unwrap()); + + frame_system::Pallet::::set_block_number(One::one()); + }: _(SystemOrigin::Signed(item_owner.clone()), pre_signed_data, signature.into(), signer.clone()) + verify { + assert_last_event::( + Event::PreSignedAttributesSet { + collection, + item, + namespace: AttributeNamespace::Account(signer.clone()), + } + .into(), + ); + } + impl_benchmark_test_suite!(Nfts, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/frame/nfts/src/features/attributes.rs b/frame/nfts/src/features/attributes.rs index e310a5e2e432f..fbd1c93247a52 100644 --- a/frame/nfts/src/features/attributes.rs +++ b/frame/nfts/src/features/attributes.rs @@ -165,6 +165,59 @@ impl, I: 'static> Pallet { Ok(()) } + pub(crate) fn do_set_attributes_pre_signed( + origin: T::AccountId, + data: PreSignedAttributesOf, + signer: T::AccountId, + ) -> DispatchResult { + let PreSignedAttributes { collection, item, attributes, namespace, deadline } = data; + + ensure!( + attributes.len() <= T::MaxAttributesPerCall::get() as usize, + Error::::MaxAttributesLimitReached + ); + + let now = frame_system::Pallet::::block_number(); + ensure!(deadline >= now, Error::::DeadlineExpired); + + let item_details = + Item::::get(&collection, &item).ok_or(Error::::UnknownItem)?; + ensure!(item_details.owner == origin, Error::::NoPermission); + + // Only the CollectionOwner and Account() namespaces could be updated in this way. + // For the Account() namespace we check and set the approval if it wasn't set before. + match &namespace { + AttributeNamespace::CollectionOwner => {}, + AttributeNamespace::Account(account) => { + ensure!(account == &signer, Error::::NoPermission); + let approvals = ItemAttributesApprovalsOf::::get(&collection, &item); + if !approvals.contains(account) { + Self::do_approve_item_attributes( + origin.clone(), + collection, + item, + account.clone(), + )?; + } + }, + _ => return Err(Error::::WrongNamespace.into()), + } + + for (key, value) in attributes { + Self::do_set_attribute( + signer.clone(), + collection, + Some(item), + namespace.clone(), + Self::construct_attribute_key(key)?, + Self::construct_attribute_value(value)?, + origin.clone(), + )?; + } + Self::deposit_event(Event::PreSignedAttributesSet { collection, item, namespace }); + Ok(()) + } + pub(crate) fn do_clear_attribute( maybe_check_owner: Option, collection: T::CollectionId, diff --git a/frame/nfts/src/lib.rs b/frame/nfts/src/lib.rs index 41313e6518867..2c3ab290cf569 100644 --- a/frame/nfts/src/lib.rs +++ b/frame/nfts/src/lib.rs @@ -526,6 +526,12 @@ pub mod pallet { price: Option>>, deadline: ::BlockNumber, }, + /// New attributes have been set for an `item` of the `collection`. + PreSignedAttributesSet { + collection: T::CollectionId, + item: T::ItemId, + namespace: AttributeNamespace, + }, } #[pallet::error] @@ -614,6 +620,8 @@ pub mod pallet { IncorrectMetadata, /// Can't set more attributes per one call. MaxAttributesLimitReached, + /// The provided namespace isn't supported in this call. + WrongNamespace, } #[pallet::call] @@ -1824,6 +1832,33 @@ pub mod pallet { ensure!(signature.verify(&*msg, &signer), Error::::WrongSignature); Self::do_mint_pre_signed(origin, mint_data, signer) } + + /// Set attributes for an item by providing the pre-signed approval. + /// + /// Origin must be Signed and must be an owner of the `data.item`. + /// + /// - `data`: The pre-signed approval that consists of the information about the item, + /// attributes to update 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 for the + /// `CollectionOwner` namespace. + /// + /// Emits `AttributeSet` for each provided attribute. + /// Emits `ItemAttributesApprovalAdded` if the approval wasn't set before. + /// Emits `PreSignedAttributesSet` on success. + #[pallet::call_index(38)] + #[pallet::weight(T::WeightInfo::set_attributes_pre_signed(data.attributes.len() as u32))] + pub fn set_attributes_pre_signed( + origin: OriginFor, + data: PreSignedAttributesOf, + signature: T::OffchainSignature, + signer: T::AccountId, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let msg = Encode::encode(&data); + ensure!(signature.verify(&*msg, &signer), Error::::WrongSignature); + Self::do_set_attributes_pre_signed(origin, data, signer) + } } } diff --git a/frame/nfts/src/tests.rs b/frame/nfts/src/tests.rs index fb8265007a261..8d937b0f7fe68 100644 --- a/frame/nfts/src/tests.rs +++ b/frame/nfts/src/tests.rs @@ -3176,3 +3176,311 @@ fn pre_signed_mints_should_work() { ); }) } + +#[test] +fn pre_signed_attributes_should_work() { + new_test_ext().execute_with(|| { + let user_1_pair = sp_core::sr25519::Pair::from_string("//Alice", None).unwrap(); + let user_1_signer = MultiSigner::Sr25519(user_1_pair.public()); + let user_1 = user_1_signer.clone().into_account(); + let user_2 = account(2); + let user_3_pair = sp_core::sr25519::Pair::from_string("//Bob", None).unwrap(); + let user_3_signer = MultiSigner::Sr25519(user_3_pair.public()); + let user_3 = user_3_signer.clone().into_account(); + let collection_id = 0; + let item_id = 0; + + Balances::make_free_balance_be(&user_1, 100); + Balances::make_free_balance_be(&user_2, 100); + Balances::make_free_balance_be(&user_3, 100); + assert_ok!(Nfts::create( + RuntimeOrigin::signed(user_1.clone()), + user_1.clone(), + collection_config_with_all_settings_enabled(), + )); + assert_ok!(Nfts::mint( + RuntimeOrigin::signed(user_1.clone()), + collection_id, + item_id, + user_2.clone(), + None, + )); + + // validate the CollectionOwner namespace + let pre_signed_data = PreSignedAttributes { + collection: 0, + item: 0, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3])], + namespace: AttributeNamespace::CollectionOwner, + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_1_pair.sign(&message)); + + assert_ok!(Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_1.clone(), + )); + + assert_eq!( + attributes(0), + vec![ + (Some(0), AttributeNamespace::CollectionOwner, bvec![0], bvec![1]), + (Some(0), AttributeNamespace::CollectionOwner, bvec![2], bvec![3]), + ] + ); + let attribute_key: BoundedVec<_, _> = bvec![0]; + let (_, deposit) = Attribute::::get(( + 0, + Some(0), + AttributeNamespace::CollectionOwner, + &attribute_key, + )) + .unwrap(); + assert_eq!(deposit.account, Some(user_2.clone())); + assert_eq!(deposit.amount, 3); + + assert_eq!(Balances::free_balance(&user_1), 100 - 2 - 1); // 2 - collection deposit, 1 - item deposit + assert_eq!(Balances::free_balance(&user_2), 100 - 6); // 6 - attributes + + // validate the deposit gets returned on attribute update from collection's owner + assert_ok!(Nfts::set_attribute( + RuntimeOrigin::signed(user_1.clone()), + collection_id, + Some(item_id), + AttributeNamespace::CollectionOwner, + bvec![0], + bvec![1], + )); + let (_, deposit) = Attribute::::get(( + 0, + Some(0), + AttributeNamespace::CollectionOwner, + &attribute_key, + )) + .unwrap(); + assert_eq!(deposit.account, None); + assert_eq!(deposit.amount, 3); + + // validate we don't partially modify the state + assert_eq!(item_attributes_approvals(collection_id, item_id), vec![]); + let pre_signed_data = PreSignedAttributes { + collection: 0, + item: 0, + attributes: vec![(vec![0], vec![1]), (vec![2; 51], vec![3])], + namespace: AttributeNamespace::Account(user_3.clone()), + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_3_pair.sign(&message)); + + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_3.clone(), + ), + Error::::IncorrectData + ); + + // no new approval was set + assert_eq!(item_attributes_approvals(collection_id, item_id), vec![]); + + // no new attributes were added + assert_eq!( + attributes(0), + vec![ + (Some(0), AttributeNamespace::CollectionOwner, bvec![0], bvec![1]), + (Some(0), AttributeNamespace::CollectionOwner, bvec![2], bvec![3]), + ] + ); + + // validate the Account namespace + let pre_signed_data = PreSignedAttributes { + collection: 0, + item: 0, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3])], + namespace: AttributeNamespace::Account(user_3.clone()), + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_3_pair.sign(&message)); + + assert_ok!(Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_3.clone(), + )); + + assert_eq!( + attributes(0), + vec![ + (Some(0), AttributeNamespace::CollectionOwner, bvec![0], bvec![1]), + (Some(0), AttributeNamespace::Account(user_3.clone()), bvec![0], bvec![1]), + (Some(0), AttributeNamespace::CollectionOwner, bvec![2], bvec![3]), + (Some(0), AttributeNamespace::Account(user_3.clone()), bvec![2], bvec![3]), + ] + ); + assert_eq!(item_attributes_approvals(collection_id, item_id), vec![user_3.clone()]); + + let attribute_key: BoundedVec<_, _> = bvec![0]; + let (_, deposit) = Attribute::::get(( + 0, + Some(0), + AttributeNamespace::Account(user_3.clone()), + &attribute_key, + )) + .unwrap(); + assert_eq!(deposit.account, Some(user_2.clone())); + assert_eq!(deposit.amount, 3); + + assert_eq!(Balances::free_balance(&user_2), 100 - 9); + assert_eq!(Balances::free_balance(&user_3), 100); + + // validate the deposit gets returned on attribute update from user_3 + assert_ok!(Nfts::set_attribute( + RuntimeOrigin::signed(user_3.clone()), + collection_id, + Some(item_id), + AttributeNamespace::Account(user_3.clone()), + bvec![0], + bvec![1], + )); + let (_, deposit) = Attribute::::get(( + 0, + Some(0), + AttributeNamespace::Account(user_3.clone()), + &attribute_key, + )) + .unwrap(); + assert_eq!(deposit.account, Some(user_3.clone())); + assert_eq!(deposit.amount, 3); + + assert_eq!(Balances::free_balance(&user_2), 100 - 6); + assert_eq!(Balances::free_balance(&user_3), 100 - 3); + + // can't update with the wrong signature + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_1.clone(), + ), + Error::::WrongSignature + ); + + // can't update if I don't own that item + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_3.clone()), + pre_signed_data.clone(), + signature.clone(), + user_3.clone(), + ), + Error::::NoPermission + ); + + // can't update the CollectionOwner namespace if the signer is not an owner of that + // collection + let pre_signed_data = PreSignedAttributes { + collection: 0, + item: 0, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3])], + namespace: AttributeNamespace::CollectionOwner, + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_3_pair.sign(&message)); + + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_3.clone(), + ), + Error::::NoPermission + ); + + // validate signature's expiration + System::set_block_number(10000001); + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_3.clone(), + ), + Error::::DeadlineExpired + ); + System::set_block_number(1); + + // validate item & collection + let pre_signed_data = PreSignedAttributes { + collection: 1, + item: 1, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3])], + namespace: AttributeNamespace::CollectionOwner, + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_1_pair.sign(&message)); + + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_1.clone(), + ), + Error::::UnknownItem + ); + + // validate max attributes limit + let pre_signed_data = PreSignedAttributes { + collection: 1, + item: 1, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3]), (vec![2], vec![3])], + namespace: AttributeNamespace::CollectionOwner, + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_1_pair.sign(&message)); + + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_1.clone(), + ), + Error::::MaxAttributesLimitReached + ); + + // validate the attribute's value length + let pre_signed_data = PreSignedAttributes { + collection: 0, + item: 0, + attributes: vec![(vec![0], vec![1]), (vec![2], vec![3; 51])], + namespace: AttributeNamespace::CollectionOwner, + deadline: 10000000, + }; + let message = Encode::encode(&pre_signed_data); + let signature = MultiSignature::Sr25519(user_1_pair.sign(&message)); + + assert_noop!( + Nfts::set_attributes_pre_signed( + RuntimeOrigin::signed(user_2.clone()), + pre_signed_data.clone(), + signature.clone(), + user_1.clone(), + ), + Error::::IncorrectData + ); + }) +} diff --git a/frame/nfts/src/types.rs b/frame/nfts/src/types.rs index 860f937aafc05..8c43024cdaceb 100644 --- a/frame/nfts/src/types.rs +++ b/frame/nfts/src/types.rs @@ -67,6 +67,12 @@ pub(super) type PreSignedMintOf = PreSignedMint< ::AccountId, ::BlockNumber, >; +pub(super) type PreSignedAttributesOf = PreSignedAttributes< + >::CollectionId, + >::ItemId, + ::AccountId, + ::BlockNumber, +>; pub trait Incrementable { fn increment(&self) -> Self; @@ -484,7 +490,7 @@ impl_codec_bitflags!(CollectionRoles, u8, CollectionRole); pub struct PreSignedMint { /// A collection of the item to be minted. pub(super) collection: CollectionId, - /// Item's id. + /// Item's ID. pub(super) item: ItemId, /// Additional item's key-value attributes. pub(super) attributes: Vec<(Vec, Vec)>, @@ -495,3 +501,17 @@ pub struct PreSignedMint { /// A deadline for the signature. pub(super) deadline: Deadline, } + +#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct PreSignedAttributes { + /// Collection's ID. + pub(super) collection: CollectionId, + /// Item's ID. + pub(super) item: ItemId, + /// Key-value attributes. + pub(super) attributes: Vec<(Vec, Vec)>, + /// Attributes' namespace. + pub(super) namespace: AttributeNamespace, + /// A deadline for the signature. + pub(super) deadline: Deadline, +} diff --git a/frame/nfts/src/weights.rs b/frame/nfts/src/weights.rs index dc59330f3e674..9eedea958ae83 100644 --- a/frame/nfts/src/weights.rs +++ b/frame/nfts/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for pallet_nfts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-b3zmxxc-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-osnnfcqu-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: @@ -87,6 +87,7 @@ pub trait WeightInfo { fn cancel_swap() -> Weight; fn claim_swap() -> Weight; fn mint_pre_signed(n: u32, ) -> Weight; + fn set_attributes_pre_signed(n: u32, ) -> Weight; } /// Weights for pallet_nfts using the Substrate node and recommended hardware. @@ -106,8 +107,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `214` // Estimated: `3054` - // Minimum execution time: 33_666 nanoseconds. - Weight::from_parts(34_405_000, 3054) + // Minimum execution time: 33_769 nanoseconds. + Weight::from_ref_time(36_031_000) + .saturating_add(Weight::from_proof_size(3054)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -125,8 +127,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3054` - // Minimum execution time: 22_028 nanoseconds. - Weight::from_parts(23_030_000, 3054) + // Minimum execution time: 21_767 nanoseconds. + Weight::from_ref_time(22_565_000) + .saturating_add(Weight::from_proof_size(3054)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -156,21 +159,22 @@ impl WeightInfo for SubstrateWeight { 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: 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())) + // Estimated: `3347427 + m * (2615 ±0) + a * (2921 ±0)` + // Minimum execution time: 26_973_627 nanoseconds. + Weight::from_ref_time(19_692_361_714) + .saturating_add(Weight::from_proof_size(3347427)) + // Standard Error: 17_036 + .saturating_add(Weight::from_ref_time(7_797_219).saturating_mul(m.into())) + // Standard Error: 17_036 + .saturating_add(Weight::from_ref_time(9_504_128).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()))) .saturating_add(T::DbWeight::get().writes(3005_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(m.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_proof_size(2921).saturating_mul(a.into())) .saturating_add(Weight::from_proof_size(2615).saturating_mul(m.into())) + .saturating_add(Weight::from_proof_size(2921).saturating_mul(a.into())) } /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) @@ -188,8 +192,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `448` // Estimated: `13506` - // Minimum execution time: 43_925 nanoseconds. - Weight::from_parts(45_885_000, 13506) + // Minimum execution time: 44_837 nanoseconds. + Weight::from_ref_time(46_794_000) + .saturating_add(Weight::from_proof_size(13506)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -209,8 +214,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `448` // Estimated: `13506` - // Minimum execution time: 42_832 nanoseconds. - Weight::from_parts(44_621_000, 13506) + // Minimum execution time: 43_976 nanoseconds. + Weight::from_ref_time(44_831_000) + .saturating_add(Weight::from_proof_size(13506)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -236,8 +242,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `647` // Estimated: `13573` - // Minimum execution time: 47_787 nanoseconds. - Weight::from_parts(49_204_000, 13573) + // Minimum execution time: 48_233 nanoseconds. + Weight::from_ref_time(50_113_000) + .saturating_add(Weight::from_proof_size(13573)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -263,8 +270,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `882` // Estimated: `16109` - // Minimum execution time: 55_524 nanoseconds. - Weight::from_parts(56_962_000, 16109) + // Minimum execution time: 55_452 nanoseconds. + Weight::from_ref_time(57_642_000) + .saturating_add(Weight::from_proof_size(16109)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -279,10 +287,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `756 + i * (140 ±0)` // Estimated: `5103 + i * (3336 ±0)` - // 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())) + // Minimum execution time: 15_598 nanoseconds. + Weight::from_ref_time(15_926_000) + .saturating_add(Weight::from_proof_size(5103)) + // Standard Error: 13_692 + .saturating_add(Weight::from_ref_time(14_040_741).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 +305,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `401` // Estimated: `5067` - // Minimum execution time: 19_270 nanoseconds. - Weight::from_parts(19_775_000, 5067) + // Minimum execution time: 19_686 nanoseconds. + Weight::from_ref_time(20_404_000) + .saturating_add(Weight::from_proof_size(5067)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -309,8 +319,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `401` // Estimated: `5067` - // Minimum execution time: 19_364 nanoseconds. - Weight::from_parts(20_274_000, 5067) + // Minimum execution time: 19_172 nanoseconds. + Weight::from_ref_time(20_151_000) + .saturating_add(Weight::from_proof_size(5067)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -322,8 +333,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `289` // Estimated: `5092` - // Minimum execution time: 17_036 nanoseconds. - Weight::from_parts(17_750_000, 5092) + // Minimum execution time: 17_063 nanoseconds. + Weight::from_ref_time(17_482_000) + .saturating_add(Weight::from_proof_size(5092)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -337,8 +349,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `381` // Estimated: `5082` - // Minimum execution time: 22_104 nanoseconds. - Weight::from_parts(23_022_000, 5082) + // Minimum execution time: 21_974 nanoseconds. + Weight::from_ref_time(22_770_000) + .saturating_add(Weight::from_proof_size(5082)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -350,8 +363,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `362` // Estimated: `2555` - // Minimum execution time: 24_516 nanoseconds. - Weight::from_parts(25_300_000, 2555) + // Minimum execution time: 24_341 nanoseconds. + Weight::from_ref_time(25_059_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -363,8 +377,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `304` // Estimated: `2555` - // Minimum execution time: 16_974 nanoseconds. - Weight::from_parts(17_654_000, 2555) + // Minimum execution time: 16_897 nanoseconds. + Weight::from_ref_time(17_560_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -376,8 +391,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `2555` - // Minimum execution time: 13_190 nanoseconds. - Weight::from_parts(13_826_000, 2555) + // Minimum execution time: 13_239 nanoseconds. + Weight::from_ref_time(13_963_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -389,8 +405,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `445` // Estimated: `5078` - // Minimum execution time: 17_336 nanoseconds. - Weight::from_parts(18_242_000, 5078) + // Minimum execution time: 17_187 nanoseconds. + Weight::from_ref_time(17_942_000) + .saturating_add(Weight::from_proof_size(5078)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -406,8 +423,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `474` // Estimated: `10547` - // Minimum execution time: 40_791 nanoseconds. - Weight::from_parts(42_489_000, 10547) + // Minimum execution time: 40_925 nanoseconds. + Weight::from_ref_time(42_733_000) + .saturating_add(Weight::from_proof_size(10547)) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -419,8 +437,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `337` // Estimated: `5476` - // Minimum execution time: 24_620 nanoseconds. - Weight::from_parts(25_370_000, 5476) + // Minimum execution time: 24_486 nanoseconds. + Weight::from_ref_time(25_409_000) + .saturating_add(Weight::from_proof_size(5476)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -434,8 +453,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `916` // Estimated: `7999` - // Minimum execution time: 36_411 nanoseconds. - Weight::from_parts(37_439_000, 7999) + // Minimum execution time: 36_643 nanoseconds. + Weight::from_ref_time(37_805_000) + .saturating_add(Weight::from_proof_size(7999)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -447,8 +467,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `379` // Estimated: `6492` - // Minimum execution time: 16_696 nanoseconds. - Weight::from_parts(17_411_000, 6492) + // Minimum execution time: 16_798 nanoseconds. + Weight::from_ref_time(17_326_000) + .saturating_add(Weight::from_proof_size(6492)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -465,10 +486,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899 + n * (396 ±0)` // Estimated: `12016 + n * (2921 ±0)` - // 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())) + // Minimum execution time: 25_524 nanoseconds. + Weight::from_ref_time(26_107_000) + .saturating_add(Weight::from_proof_size(12016)) + // Standard Error: 5_460 + .saturating_add(Weight::from_ref_time(9_030_830).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 +509,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `474` // Estimated: `10241` - // Minimum execution time: 34_150 nanoseconds. - Weight::from_parts(35_398_000, 10241) + // Minimum execution time: 34_400 nanoseconds. + Weight::from_ref_time(35_469_000) + .saturating_add(Weight::from_proof_size(10241)) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -502,8 +525,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `609` // Estimated: `7693` - // Minimum execution time: 31_871 nanoseconds. - Weight::from_parts(33_057_000, 7693) + // Minimum execution time: 31_560 nanoseconds. + Weight::from_ref_time(33_081_000) + .saturating_add(Weight::from_proof_size(7693)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -517,8 +541,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `333` // Estimated: `7665` - // Minimum execution time: 28_843 nanoseconds. - Weight::from_parts(30_057_000, 7665) + // Minimum execution time: 28_821 nanoseconds. + Weight::from_ref_time(30_010_000) + .saturating_add(Weight::from_proof_size(7665)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -532,8 +557,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `476` // Estimated: `7665` - // Minimum execution time: 27_777 nanoseconds. - Weight::from_parts(28_471_000, 7665) + // Minimum execution time: 27_608 nanoseconds. + Weight::from_ref_time(28_766_000) + .saturating_add(Weight::from_proof_size(7665)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -547,8 +573,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `466` // Estimated: `8428` - // Minimum execution time: 23_726 nanoseconds. - Weight::from_parts(24_455_000, 8428) + // Minimum execution time: 23_987 nanoseconds. + Weight::from_ref_time(24_819_000) + .saturating_add(Weight::from_proof_size(8428)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -560,8 +587,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `474` // Estimated: `5880` - // Minimum execution time: 21_051 nanoseconds. - Weight::from_parts(21_722_000, 5880) + // Minimum execution time: 21_254 nanoseconds. + Weight::from_ref_time(21_826_000) + .saturating_add(Weight::from_proof_size(5880)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -573,8 +601,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `474` // Estimated: `5880` - // Minimum execution time: 20_095 nanoseconds. - Weight::from_parts(20_770_000, 5880) + // Minimum execution time: 20_272 nanoseconds. + Weight::from_ref_time(20_922_000) + .saturating_add(Weight::from_proof_size(5880)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -584,8 +613,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `2527` - // Minimum execution time: 14_078 nanoseconds. - Weight::from_parts(14_582_000, 2527) + // Minimum execution time: 14_287 nanoseconds. + Weight::from_ref_time(14_960_000) + .saturating_add(Weight::from_proof_size(2527)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -597,8 +627,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `333` // Estimated: `5103` - // Minimum execution time: 17_677 nanoseconds. - Weight::from_parts(18_381_000, 5103) + // Minimum execution time: 17_948 nanoseconds. + Weight::from_ref_time(18_780_000) + .saturating_add(Weight::from_proof_size(5103)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -610,8 +641,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `333` // Estimated: `5103` - // Minimum execution time: 16_295 nanoseconds. - Weight::from_parts(17_036_000, 5103) + // Minimum execution time: 16_616 nanoseconds. + Weight::from_ref_time(17_155_000) + .saturating_add(Weight::from_proof_size(5103)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -627,8 +659,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `516` // Estimated: `8407` - // Minimum execution time: 22_847 nanoseconds. - Weight::from_parts(23_536_000, 8407) + // Minimum execution time: 22_777 nanoseconds. + Weight::from_ref_time(23_955_000) + .saturating_add(Weight::from_proof_size(8407)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -652,8 +685,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `934` // Estimated: `16129` - // Minimum execution time: 60_517 nanoseconds. - Weight::from_parts(62_528_000, 16129) + // Minimum execution time: 61_131 nanoseconds. + Weight::from_ref_time(62_791_000) + .saturating_add(Weight::from_proof_size(16129)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -662,10 +696,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // 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())) + // Minimum execution time: 1_952 nanoseconds. + Weight::from_ref_time(3_975_700) + .saturating_add(Weight::from_proof_size(0)) + // Standard Error: 11_254 + .saturating_add(Weight::from_ref_time(3_501_698).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 +710,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `524` // Estimated: `6672` - // Minimum execution time: 21_174 nanoseconds. - Weight::from_parts(21_619_000, 6672) + // Minimum execution time: 20_327 nanoseconds. + Weight::from_ref_time(21_714_000) + .saturating_add(Weight::from_proof_size(6672)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -688,8 +724,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `511` // Estimated: `5882` - // Minimum execution time: 20_606 nanoseconds. - Weight::from_parts(21_150_000, 5882) + // Minimum execution time: 20_668 nanoseconds. + Weight::from_ref_time(21_416_000) + .saturating_add(Weight::from_proof_size(5882)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -713,8 +750,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1097` // Estimated: `21970` - // Minimum execution time: 88_414 nanoseconds. - Weight::from_parts(91_830_000, 21970) + // Minimum execution time: 88_006 nanoseconds. + Weight::from_ref_time(90_390_000) + .saturating_add(Weight::from_proof_size(21970)) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } @@ -739,16 +777,45 @@ impl WeightInfo for SubstrateWeight { // 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())) + // Minimum execution time: 124_967 nanoseconds. + Weight::from_ref_time(131_602_642) + .saturating_add(Weight::from_proof_size(16180)) + // Standard Error: 36_480 + .saturating_add(Weight::from_ref_time(25_811_394).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())) } + /// Storage: Nfts Item (r:1 w:0) + /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) + /// Storage: Nfts ItemAttributesApprovalsOf (r:1 w:1) + /// Proof: Nfts ItemAttributesApprovalsOf (max_values: None, max_size: Some(681), added: 3156, mode: MaxEncodedLen) + /// 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 Attribute (r:10 w:10) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(446), added: 2921, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `n` is `[0, 10]`. + fn set_attributes_pre_signed(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `716` + // Estimated: `14198 + n * (2921 ±0)` + // Minimum execution time: 84_153 nanoseconds. + Weight::from_ref_time(96_401_623) + .saturating_add(Weight::from_proof_size(14198)) + // Standard Error: 70_244 + .saturating_add(Weight::from_ref_time(26_866_222).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)) + .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 @@ -767,8 +834,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `214` // Estimated: `3054` - // Minimum execution time: 33_666 nanoseconds. - Weight::from_parts(34_405_000, 3054) + // Minimum execution time: 33_769 nanoseconds. + Weight::from_ref_time(36_031_000) + .saturating_add(Weight::from_proof_size(3054)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -786,8 +854,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3054` - // Minimum execution time: 22_028 nanoseconds. - Weight::from_parts(23_030_000, 3054) + // Minimum execution time: 21_767 nanoseconds. + Weight::from_ref_time(22_565_000) + .saturating_add(Weight::from_proof_size(3054)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -817,21 +886,22 @@ impl WeightInfo for () { 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: 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())) + // Estimated: `3347427 + m * (2615 ±0) + a * (2921 ±0)` + // Minimum execution time: 26_973_627 nanoseconds. + Weight::from_ref_time(19_692_361_714) + .saturating_add(Weight::from_proof_size(3347427)) + // Standard Error: 17_036 + .saturating_add(Weight::from_ref_time(7_797_219).saturating_mul(m.into())) + // Standard Error: 17_036 + .saturating_add(Weight::from_ref_time(9_504_128).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()))) .saturating_add(RocksDbWeight::get().writes(3005_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(m.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_proof_size(2921).saturating_mul(a.into())) .saturating_add(Weight::from_proof_size(2615).saturating_mul(m.into())) + .saturating_add(Weight::from_proof_size(2921).saturating_mul(a.into())) } /// Storage: Nfts CollectionConfigOf (r:1 w:0) /// Proof: Nfts CollectionConfigOf (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen) @@ -849,8 +919,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `448` // Estimated: `13506` - // Minimum execution time: 43_925 nanoseconds. - Weight::from_parts(45_885_000, 13506) + // Minimum execution time: 44_837 nanoseconds. + Weight::from_ref_time(46_794_000) + .saturating_add(Weight::from_proof_size(13506)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -870,8 +941,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `448` // Estimated: `13506` - // Minimum execution time: 42_832 nanoseconds. - Weight::from_parts(44_621_000, 13506) + // Minimum execution time: 43_976 nanoseconds. + Weight::from_ref_time(44_831_000) + .saturating_add(Weight::from_proof_size(13506)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -897,8 +969,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `647` // Estimated: `13573` - // Minimum execution time: 47_787 nanoseconds. - Weight::from_parts(49_204_000, 13573) + // Minimum execution time: 48_233 nanoseconds. + Weight::from_ref_time(50_113_000) + .saturating_add(Weight::from_proof_size(13573)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -924,8 +997,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `882` // Estimated: `16109` - // Minimum execution time: 55_524 nanoseconds. - Weight::from_parts(56_962_000, 16109) + // Minimum execution time: 55_452 nanoseconds. + Weight::from_ref_time(57_642_000) + .saturating_add(Weight::from_proof_size(16109)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -940,10 +1014,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `756 + i * (140 ±0)` // Estimated: `5103 + i * (3336 ±0)` - // 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())) + // Minimum execution time: 15_598 nanoseconds. + Weight::from_ref_time(15_926_000) + .saturating_add(Weight::from_proof_size(5103)) + // Standard Error: 13_692 + .saturating_add(Weight::from_ref_time(14_040_741).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()))) @@ -957,8 +1032,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `401` // Estimated: `5067` - // Minimum execution time: 19_270 nanoseconds. - Weight::from_parts(19_775_000, 5067) + // Minimum execution time: 19_686 nanoseconds. + Weight::from_ref_time(20_404_000) + .saturating_add(Weight::from_proof_size(5067)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -970,8 +1046,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `401` // Estimated: `5067` - // Minimum execution time: 19_364 nanoseconds. - Weight::from_parts(20_274_000, 5067) + // Minimum execution time: 19_172 nanoseconds. + Weight::from_ref_time(20_151_000) + .saturating_add(Weight::from_proof_size(5067)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -983,8 +1060,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `289` // Estimated: `5092` - // Minimum execution time: 17_036 nanoseconds. - Weight::from_parts(17_750_000, 5092) + // Minimum execution time: 17_063 nanoseconds. + Weight::from_ref_time(17_482_000) + .saturating_add(Weight::from_proof_size(5092)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -998,8 +1076,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `381` // Estimated: `5082` - // Minimum execution time: 22_104 nanoseconds. - Weight::from_parts(23_022_000, 5082) + // Minimum execution time: 21_974 nanoseconds. + Weight::from_ref_time(22_770_000) + .saturating_add(Weight::from_proof_size(5082)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1011,8 +1090,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `362` // Estimated: `2555` - // Minimum execution time: 24_516 nanoseconds. - Weight::from_parts(25_300_000, 2555) + // Minimum execution time: 24_341 nanoseconds. + Weight::from_ref_time(25_059_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -1024,8 +1104,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `304` // Estimated: `2555` - // Minimum execution time: 16_974 nanoseconds. - Weight::from_parts(17_654_000, 2555) + // Minimum execution time: 16_897 nanoseconds. + Weight::from_ref_time(17_560_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1037,8 +1118,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `242` // Estimated: `2555` - // Minimum execution time: 13_190 nanoseconds. - Weight::from_parts(13_826_000, 2555) + // Minimum execution time: 13_239 nanoseconds. + Weight::from_ref_time(13_963_000) + .saturating_add(Weight::from_proof_size(2555)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1050,8 +1132,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `445` // Estimated: `5078` - // Minimum execution time: 17_336 nanoseconds. - Weight::from_parts(18_242_000, 5078) + // Minimum execution time: 17_187 nanoseconds. + Weight::from_ref_time(17_942_000) + .saturating_add(Weight::from_proof_size(5078)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1067,8 +1150,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `474` // Estimated: `10547` - // Minimum execution time: 40_791 nanoseconds. - Weight::from_parts(42_489_000, 10547) + // Minimum execution time: 40_925 nanoseconds. + Weight::from_ref_time(42_733_000) + .saturating_add(Weight::from_proof_size(10547)) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1080,8 +1164,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `337` // Estimated: `5476` - // Minimum execution time: 24_620 nanoseconds. - Weight::from_parts(25_370_000, 5476) + // Minimum execution time: 24_486 nanoseconds. + Weight::from_ref_time(25_409_000) + .saturating_add(Weight::from_proof_size(5476)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1095,8 +1180,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `916` // Estimated: `7999` - // Minimum execution time: 36_411 nanoseconds. - Weight::from_parts(37_439_000, 7999) + // Minimum execution time: 36_643 nanoseconds. + Weight::from_ref_time(37_805_000) + .saturating_add(Weight::from_proof_size(7999)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1108,8 +1194,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `379` // Estimated: `6492` - // Minimum execution time: 16_696 nanoseconds. - Weight::from_parts(17_411_000, 6492) + // Minimum execution time: 16_798 nanoseconds. + Weight::from_ref_time(17_326_000) + .saturating_add(Weight::from_proof_size(6492)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1126,10 +1213,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899 + n * (396 ±0)` // Estimated: `12016 + n * (2921 ±0)` - // 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())) + // Minimum execution time: 25_524 nanoseconds. + Weight::from_ref_time(26_107_000) + .saturating_add(Weight::from_proof_size(12016)) + // Standard Error: 5_460 + .saturating_add(Weight::from_ref_time(9_030_830).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)) @@ -1148,8 +1236,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `474` // Estimated: `10241` - // Minimum execution time: 34_150 nanoseconds. - Weight::from_parts(35_398_000, 10241) + // Minimum execution time: 34_400 nanoseconds. + Weight::from_ref_time(35_469_000) + .saturating_add(Weight::from_proof_size(10241)) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1163,8 +1252,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `609` // Estimated: `7693` - // Minimum execution time: 31_871 nanoseconds. - Weight::from_parts(33_057_000, 7693) + // Minimum execution time: 31_560 nanoseconds. + Weight::from_ref_time(33_081_000) + .saturating_add(Weight::from_proof_size(7693)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1178,8 +1268,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `333` // Estimated: `7665` - // Minimum execution time: 28_843 nanoseconds. - Weight::from_parts(30_057_000, 7665) + // Minimum execution time: 28_821 nanoseconds. + Weight::from_ref_time(30_010_000) + .saturating_add(Weight::from_proof_size(7665)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1193,8 +1284,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `476` // Estimated: `7665` - // Minimum execution time: 27_777 nanoseconds. - Weight::from_parts(28_471_000, 7665) + // Minimum execution time: 27_608 nanoseconds. + Weight::from_ref_time(28_766_000) + .saturating_add(Weight::from_proof_size(7665)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1208,8 +1300,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `466` // Estimated: `8428` - // Minimum execution time: 23_726 nanoseconds. - Weight::from_parts(24_455_000, 8428) + // Minimum execution time: 23_987 nanoseconds. + Weight::from_ref_time(24_819_000) + .saturating_add(Weight::from_proof_size(8428)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1221,8 +1314,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `474` // Estimated: `5880` - // Minimum execution time: 21_051 nanoseconds. - Weight::from_parts(21_722_000, 5880) + // Minimum execution time: 21_254 nanoseconds. + Weight::from_ref_time(21_826_000) + .saturating_add(Weight::from_proof_size(5880)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1234,8 +1328,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `474` // Estimated: `5880` - // Minimum execution time: 20_095 nanoseconds. - Weight::from_parts(20_770_000, 5880) + // Minimum execution time: 20_272 nanoseconds. + Weight::from_ref_time(20_922_000) + .saturating_add(Weight::from_proof_size(5880)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1245,8 +1340,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `2527` - // Minimum execution time: 14_078 nanoseconds. - Weight::from_parts(14_582_000, 2527) + // Minimum execution time: 14_287 nanoseconds. + Weight::from_ref_time(14_960_000) + .saturating_add(Weight::from_proof_size(2527)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1258,8 +1354,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `333` // Estimated: `5103` - // Minimum execution time: 17_677 nanoseconds. - Weight::from_parts(18_381_000, 5103) + // Minimum execution time: 17_948 nanoseconds. + Weight::from_ref_time(18_780_000) + .saturating_add(Weight::from_proof_size(5103)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1271,8 +1368,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `333` // Estimated: `5103` - // Minimum execution time: 16_295 nanoseconds. - Weight::from_parts(17_036_000, 5103) + // Minimum execution time: 16_616 nanoseconds. + Weight::from_ref_time(17_155_000) + .saturating_add(Weight::from_proof_size(5103)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1288,8 +1386,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `516` // Estimated: `8407` - // Minimum execution time: 22_847 nanoseconds. - Weight::from_parts(23_536_000, 8407) + // Minimum execution time: 22_777 nanoseconds. + Weight::from_ref_time(23_955_000) + .saturating_add(Weight::from_proof_size(8407)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1313,8 +1412,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `934` // Estimated: `16129` - // Minimum execution time: 60_517 nanoseconds. - Weight::from_parts(62_528_000, 16129) + // Minimum execution time: 61_131 nanoseconds. + Weight::from_ref_time(62_791_000) + .saturating_add(Weight::from_proof_size(16129)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1323,10 +1423,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // 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())) + // Minimum execution time: 1_952 nanoseconds. + Weight::from_ref_time(3_975_700) + .saturating_add(Weight::from_proof_size(0)) + // Standard Error: 11_254 + .saturating_add(Weight::from_ref_time(3_501_698).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) @@ -1336,8 +1437,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `524` // Estimated: `6672` - // Minimum execution time: 21_174 nanoseconds. - Weight::from_parts(21_619_000, 6672) + // Minimum execution time: 20_327 nanoseconds. + Weight::from_ref_time(21_714_000) + .saturating_add(Weight::from_proof_size(6672)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1349,8 +1451,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `511` // Estimated: `5882` - // Minimum execution time: 20_606 nanoseconds. - Weight::from_parts(21_150_000, 5882) + // Minimum execution time: 20_668 nanoseconds. + Weight::from_ref_time(21_416_000) + .saturating_add(Weight::from_proof_size(5882)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1374,8 +1477,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1097` // Estimated: `21970` - // Minimum execution time: 88_414 nanoseconds. - Weight::from_parts(91_830_000, 21970) + // Minimum execution time: 88_006 nanoseconds. + Weight::from_ref_time(90_390_000) + .saturating_add(Weight::from_proof_size(21970)) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) } @@ -1400,14 +1504,43 @@ impl WeightInfo for () { // 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())) + // Minimum execution time: 124_967 nanoseconds. + Weight::from_ref_time(131_602_642) + .saturating_add(Weight::from_proof_size(16180)) + // Standard Error: 36_480 + .saturating_add(Weight::from_ref_time(25_811_394).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())) } + /// Storage: Nfts Item (r:1 w:0) + /// Proof: Nfts Item (max_values: None, max_size: Some(861), added: 3336, mode: MaxEncodedLen) + /// Storage: Nfts ItemAttributesApprovalsOf (r:1 w:1) + /// Proof: Nfts ItemAttributesApprovalsOf (max_values: None, max_size: Some(681), added: 3156, mode: MaxEncodedLen) + /// 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 Attribute (r:10 w:10) + /// Proof: Nfts Attribute (max_values: None, max_size: Some(446), added: 2921, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `n` is `[0, 10]`. + fn set_attributes_pre_signed(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `716` + // Estimated: `14198 + n * (2921 ±0)` + // Minimum execution time: 84_153 nanoseconds. + Weight::from_ref_time(96_401_623) + .saturating_add(Weight::from_proof_size(14198)) + // Standard Error: 70_244 + .saturating_add(Weight::from_ref_time(26_866_222).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)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_proof_size(2921).saturating_mul(n.into())) + } }