difftreelog
refactor(interface) remove outdated benchmarks
in: master
3 files changed
pallets/nft/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -7,35 +7,10 @@
use nft_data_structs::*;
use core::convert::TryInto;
use sp_runtime::DispatchError;
+use pallet_common::benchmarking::{create_data, create_u16_data};
const SEED: u32 = 1;
-
-fn create_data(size: usize) -> Vec<u8> {
- (0..size).map(|v| (v & 0xff) as u8).collect()
-}
-fn create_u16_data(size: usize) -> Vec<u16> {
- (0..size).map(|v| (v & 0xffff) as u16).collect()
-}
-
-fn default_nft_data() -> CreateItemData {
- CreateItemData::NFT(CreateNftData {
- const_data: create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap(),
- variable_data: create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap(),
- })
-}
-fn default_fungible_data() -> CreateItemData {
- CreateItemData::Fungible(CreateFungibleData { value: 1000 })
-}
-
-fn default_re_fungible_data() -> CreateItemData {
- CreateItemData::ReFungible(CreateReFungibleData {
- const_data: create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap(),
- variable_data: create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap(),
- pieces: 1000,
- })
-}
-
fn create_collection_helper<T: Config>(
owner: T::AccountId,
mode: CollectionMode,
@@ -55,20 +30,10 @@
token_prefix,
mode,
)?;
- Ok(CreatedCollectionCount::get())
+ Ok(<pallet_common::CreatedCollectionCount<T>>::get())
}
fn create_nft_collection<T: Config>(owner: T::AccountId) -> Result<CollectionId, DispatchError> {
create_collection_helper::<T>(owner, CollectionMode::NFT)
-}
-fn create_fungible_collection<T: Config>(
- owner: T::AccountId,
-) -> Result<CollectionId, DispatchError> {
- create_collection_helper::<T>(owner, CollectionMode::Fungible(0))
-}
-fn create_refungible_collection<T: Config>(
- owner: T::AccountId,
-) -> Result<CollectionId, DispatchError> {
- create_collection_helper::<T>(owner, CollectionMode::ReFungible)
}
benchmarks! {
@@ -82,7 +47,7 @@
T::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get());
}: _(RawOrigin::Signed(caller.clone()), col_name.clone(), col_desc.clone(), token_prefix.clone(), mode)
verify {
- assert_eq!(<Pallet<T>>::collection_id(2).unwrap().owner, caller);
+ assert_eq!(<pallet_common::CollectionById<T>>::get(CollectionId(1)).unwrap().owner, caller);
}
destroy_collection {
@@ -129,7 +94,7 @@
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
let new_admin: T::AccountId = account("admin", 0, SEED);
- <Pallet<T>>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(new_admin.clone()))?;
+ <Pallet<T>>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(new_admin.clone()))?;
}: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(new_admin))
set_collection_sponsor {
@@ -140,152 +105,21 @@
confirm_sponsorship {
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
- <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+ <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;
}: _(RawOrigin::Signed(caller.clone()), collection)
remove_collection_sponsor {
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
- <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
- <Pallet<T>>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
+ <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;
+ <Pallet<T>>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), collection)?;
}: _(RawOrigin::Signed(caller.clone()), collection)
-
- // nft item
- create_item_nft {
- let b in 0..(CUSTOM_DATA_LIMIT * 2);
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let data = CreateItemData::NFT(CreateNftData {
- const_data: create_data(b.min(CUSTOM_DATA_LIMIT) as usize).try_into().unwrap(),
- variable_data: create_data(b.saturating_sub(CUSTOM_DATA_LIMIT) as usize).try_into().unwrap(),
- });
- }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
-
- create_multiple_items_nft {
- // TODO: Take item data size into account. As create_item_nft bench shows, this parameter has no effect on execution time,
- // but it may if we increase CUSTOM_DATA_LIMIT
- let b in 1..1000;
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let data = (0..b).map(|_| default_nft_data()).collect();
- }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
- // fungible item
- create_item_fungible {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_fungible_collection::<T>(caller.clone())?;
- let data = CreateItemData::Fungible(CreateFungibleData {
- value: 1000,
- });
- }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
-
- create_multiple_items_fungible {
- let b in 1..1000;
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_fungible_collection::<T>(caller.clone())?;
- let data = (0..b).map(|_| default_fungible_data()).collect();
- }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
-
- // refungible item
- create_item_refungible {
- let b in 0..(CUSTOM_DATA_LIMIT * 2);
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_refungible_collection::<T>(caller.clone())?;
- let data = CreateItemData::ReFungible(CreateReFungibleData {
- const_data: create_data(b.min(CUSTOM_DATA_LIMIT) as usize).try_into().unwrap(),
- variable_data: create_data(b.saturating_sub(CUSTOM_DATA_LIMIT) as usize).try_into().unwrap(),
- pieces: 1000,
- });
- }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
-
- create_multiple_items_refungible {
- // TODO: Take item data size into account. As create_item_nft bench shows, this parameter has no effect on execution time,
- // but it may if we increase CUSTOM_DATA_LIMIT
- let b in 1..1000;
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_refungible_collection::<T>(caller.clone())?;
- let data = (0..b).map(|_| default_re_fungible_data()).collect();
- }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)
-
- burn_item_nft {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let data = default_nft_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;
- }: burn_item(RawOrigin::Signed(caller.clone()), collection, 1, 1)
-
- transfer_nft {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_nft_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)
-
- transfer_fungible {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_fungible_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_fungible_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)
-
- transfer_refungible {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_refungible_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_re_fungible_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)
-
set_transfers_enabled_flag {
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
}: _(RawOrigin::Signed(caller.clone()), collection, false)
-
- approve_nft {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_nft_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(caller.clone()), data)?;
- }: approve(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)
- // Nft
- transfer_from_nft {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_nft_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(caller.clone()), data)?;
- <Pallet<T>>::approve(RawOrigin::Signed(caller.clone()).into(), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)
-
- // Fungible
- transfer_from_fungible {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_fungible_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_fungible_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(caller.clone()), data)?;
- <Pallet<T>>::approve(RawOrigin::Signed(caller.clone()).into(), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)
-
- // ReFungible
- transfer_from_refungible {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_refungible_collection::<T>(caller.clone())?;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let data = default_re_fungible_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(caller.clone()), data)?;
- <Pallet<T>>::approve(RawOrigin::Signed(caller.clone()).into(), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), 2, 1, 1)
-
set_offchain_schema {
let b in 0..OFFCHAIN_SCHEMA_LIMIT;
@@ -308,29 +142,19 @@
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
let data = create_data(b as usize);
- }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, data)
-
- set_variable_meta_data_nft {
- let b in 0..CUSTOM_DATA_LIMIT;
-
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- let data = default_nft_data();
- <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, T::CrossAccountId::from_sub(caller.clone()), data)?;
- let data = create_data(b as usize);
- }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), collection, 1, data)
+ }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), collection, data)
set_schema_version {
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
- }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
+ }: set_schema_version(RawOrigin::Signed(caller.clone()), collection, SchemaVersion::Unique)
set_collection_limits{
let caller: T::AccountId = account("caller", 0, SEED);
let collection = create_nft_collection::<T>(caller.clone())?;
let cl = CollectionLimits {
- account_token_ownership_limit: 0,
+ account_token_ownership_limit: Some(0),
sponsored_data_size: 0,
token_limit: 1,
sponsor_transfer_timeout: 0,
@@ -338,5 +162,10 @@
owner_can_transfer: true,
sponsored_data_rate_limit: None,
};
- }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
+ }: set_collection_limits(RawOrigin::Signed(caller.clone()), collection, cl)
+
+ set_meta_update_permission_flag {
+ let caller: T::AccountId = account("caller", 0, SEED);
+ let collection = create_nft_collection::<T>(caller.clone())?;
+ }: _(RawOrigin::Signed(caller.clone()), collection, MetaUpdatePermission::Admin)
}
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -100,38 +100,6 @@
type SelfWeightOf<T> = <T as Config>::WeightInfo;
-trait WeightInfoHelpers: WeightInfo {
- fn transfer() -> Weight {
- Self::transfer_nft()
- .max(Self::transfer_fungible())
- .max(Self::transfer_refungible())
- }
- fn transfer_from() -> Weight {
- Self::transfer_from_nft()
- .max(Self::transfer_from_fungible())
- .max(Self::transfer_from_refungible())
- }
- fn approve() -> Weight {
- // TODO: refungible, fungible
- Self::approve_nft()
- }
- fn set_variable_meta_data(data: u32) -> Weight {
- // TODO: refungible
- Self::set_variable_meta_data_nft(data)
- }
- fn create_item(data: u32) -> Weight {
- Self::create_item_nft(data)
- .max(Self::create_item_fungible())
- .max(Self::create_item_refungible(data))
- }
- fn create_multiple_items(amount: u32) -> Weight {
- Self::create_multiple_items_nft(amount)
- .max(Self::create_multiple_items_fungible(amount))
- .max(Self::create_multiple_items_refungible(amount))
- }
-}
-impl<T: WeightInfo> WeightInfoHelpers for T {}
-
// # Used definitions
//
// ## User control levels
@@ -754,7 +722,7 @@
/// * collection_id: ID of the collection.
///
/// * value: New flag value.
- #[weight = <SelfWeightOf<T>>::set_variable_meta_data(0)]
+ #[weight = <SelfWeightOf<T>>::set_meta_update_permission_flag()]
#[transactional]
pub fn set_meta_update_permission_flag(origin, collection_id: CollectionId, value: MetaUpdatePermission) -> DispatchResult {
let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
pallets/nft/src/weights.rsdiffbeforeafterboth1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs23//! Autogenerated weights for pallet_nft4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev6//! DATE: 2021-10-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 12889// Executed Command:10// target/release/nft11// benchmark12// --pallet13// pallet-nft14// --wasm-execution15// compiled16// --extrinsic17// *18// --template19// .maintain/frame-weight-template.hbs20// --steps=5021// --repeat=2022// --output=./pallets/nft/src/weights.rs232425#![cfg_attr(rustfmt, rustfmt_skip)]26#![allow(unused_parens)]27#![allow(unused_imports)]2829use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};30use sp_std::marker::PhantomData;3132/// Weight functions needed for pallet_nft.33pub trait WeightInfo {34 fn create_collection() -> Weight;35 fn destroy_collection() -> Weight;36 fn add_to_white_list() -> Weight;37 fn remove_from_white_list() -> Weight;38 fn set_public_access_mode() -> Weight;39 fn set_mint_permission() -> Weight;40 fn change_collection_owner() -> Weight;41 fn add_collection_admin() -> Weight;42 fn remove_collection_admin() -> Weight;43 fn set_collection_sponsor() -> Weight;44 fn confirm_sponsorship() -> Weight;45 fn remove_collection_sponsor() -> Weight;46 fn set_transfers_enabled_flag() -> Weight;47 fn set_offchain_schema(b: u32, ) -> Weight;48 fn set_const_on_chain_schema(b: u32, ) -> Weight;49 fn set_variable_on_chain_schema(b: u32, ) -> Weight;50 fn set_schema_version() -> Weight;51 fn set_collection_limits() -> Weight;52 fn set_meta_update_permission_flag() -> Weight;53}5455/// Weights for pallet_nft using the Substrate node and recommended hardware.56pub struct SubstrateWeight<T>(PhantomData<T>);57impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {58 // Storage: Common CreatedCollectionCount (r:1 w:1)59 // Storage: Common DestroyedCollectionCount (r:1 w:0)60 // Storage: System Account (r:2 w:2)61 // Storage: Common CollectionById (r:0 w:1)62 fn create_collection() -> Weight {63 (23_803_000 as Weight)64 .saturating_add(T::DbWeight::get().reads(4 as Weight))65 .saturating_add(T::DbWeight::get().writes(4 as Weight))66 }67 // Storage: Common CollectionById (r:1 w:1)68 // Storage: Common DestroyedCollectionCount (r:1 w:1)69 // Storage: Nonfungible TokensMinted (r:0 w:1)70 // Storage: Nonfungible TokensBurnt (r:0 w:1)71 fn destroy_collection() -> Weight {72 (27_831_000 as Weight)73 .saturating_add(T::DbWeight::get().reads(2 as Weight))74 .saturating_add(T::DbWeight::get().writes(4 as Weight))75 }76 // Storage: Common CollectionById (r:1 w:0)77 // Storage: Common Allowlist (r:0 w:1)78 fn add_to_white_list() -> Weight {79 (6_629_000 as Weight)80 .saturating_add(T::DbWeight::get().reads(1 as Weight))81 .saturating_add(T::DbWeight::get().writes(1 as Weight))82 }83 // Storage: Common CollectionById (r:1 w:0)84 // Storage: Common Allowlist (r:0 w:1)85 fn remove_from_white_list() -> Weight {86 (6_596_000 as Weight)87 .saturating_add(T::DbWeight::get().reads(1 as Weight))88 .saturating_add(T::DbWeight::get().writes(1 as Weight))89 }90 // Storage: Common CollectionById (r:1 w:1)91 fn set_public_access_mode() -> Weight {92 (6_338_000 as Weight)93 .saturating_add(T::DbWeight::get().reads(1 as Weight))94 .saturating_add(T::DbWeight::get().writes(1 as Weight))95 }96 // Storage: Common CollectionById (r:1 w:1)97 fn set_mint_permission() -> Weight {98 (6_383_000 as Weight)99 .saturating_add(T::DbWeight::get().reads(1 as Weight))100 .saturating_add(T::DbWeight::get().writes(1 as Weight))101 }102 // Storage: Common CollectionById (r:1 w:1)103 fn change_collection_owner() -> Weight {104 (6_493_000 as Weight)105 .saturating_add(T::DbWeight::get().reads(1 as Weight))106 .saturating_add(T::DbWeight::get().writes(1 as Weight))107 }108 // Storage: Common CollectionById (r:1 w:0)109 // Storage: Common IsAdmin (r:0 w:1)110 fn add_collection_admin() -> Weight {111 (6_850_000 as Weight)112 .saturating_add(T::DbWeight::get().reads(1 as Weight))113 .saturating_add(T::DbWeight::get().writes(1 as Weight))114 }115 // Storage: Common CollectionById (r:1 w:0)116 // Storage: Common IsAdmin (r:0 w:1)117 fn remove_collection_admin() -> Weight {118 (6_615_000 as Weight)119 .saturating_add(T::DbWeight::get().reads(1 as Weight))120 .saturating_add(T::DbWeight::get().writes(1 as Weight))121 }122 // Storage: Common CollectionById (r:1 w:1)123 fn set_collection_sponsor() -> Weight {124 (6_430_000 as Weight)125 .saturating_add(T::DbWeight::get().reads(1 as Weight))126 .saturating_add(T::DbWeight::get().writes(1 as Weight))127 }128 // Storage: Common CollectionById (r:1 w:1)129 fn confirm_sponsorship() -> Weight {130 (6_125_000 as Weight)131 .saturating_add(T::DbWeight::get().reads(1 as Weight))132 .saturating_add(T::DbWeight::get().writes(1 as Weight))133 }134 // Storage: Common CollectionById (r:1 w:1)135 fn remove_collection_sponsor() -> Weight {136 (6_236_000 as Weight)137 .saturating_add(T::DbWeight::get().reads(1 as Weight))138 .saturating_add(T::DbWeight::get().writes(1 as Weight))139 }140 // Storage: Common CollectionById (r:1 w:1)141 fn set_transfers_enabled_flag() -> Weight {142 (6_500_000 as Weight)143 .saturating_add(T::DbWeight::get().reads(1 as Weight))144 .saturating_add(T::DbWeight::get().writes(1 as Weight))145 }146 // Storage: Common CollectionById (r:1 w:1)147 fn set_offchain_schema(_b: u32, ) -> Weight {148 (6_538_000 as Weight)149 .saturating_add(T::DbWeight::get().reads(1 as Weight))150 .saturating_add(T::DbWeight::get().writes(1 as Weight))151 }152 // Storage: Common CollectionById (r:1 w:1)153 fn set_const_on_chain_schema(_b: u32, ) -> Weight {154 (6_542_000 as Weight)155 .saturating_add(T::DbWeight::get().reads(1 as Weight))156 .saturating_add(T::DbWeight::get().writes(1 as Weight))157 }158 // Storage: Common CollectionById (r:1 w:1)159 fn set_variable_on_chain_schema(b: u32, ) -> Weight {160 (6_092_000 as Weight)161 // Standard Error: 0162 .saturating_add((2_000 as Weight).saturating_mul(b as Weight))163 .saturating_add(T::DbWeight::get().reads(1 as Weight))164 .saturating_add(T::DbWeight::get().writes(1 as Weight))165 }166 // Storage: Common CollectionById (r:1 w:1)167 fn set_schema_version() -> Weight {168 (6_470_000 as Weight)169 .saturating_add(T::DbWeight::get().reads(1 as Weight))170 .saturating_add(T::DbWeight::get().writes(1 as Weight))171 }172 // Storage: Common CollectionById (r:1 w:1)173 fn set_collection_limits() -> Weight {174 (6_841_000 as Weight)175 .saturating_add(T::DbWeight::get().reads(1 as Weight))176 .saturating_add(T::DbWeight::get().writes(1 as Weight))177 }178 // Storage: Common CollectionById (r:1 w:1)179 fn set_meta_update_permission_flag() -> Weight {180 (6_278_000 as Weight)181 .saturating_add(T::DbWeight::get().reads(1 as Weight))182 .saturating_add(T::DbWeight::get().writes(1 as Weight))183 }184}185186// For backwards compatibility and tests187impl WeightInfo for () {188 // Storage: Common CreatedCollectionCount (r:1 w:1)189 // Storage: Common DestroyedCollectionCount (r:1 w:0)190 // Storage: System Account (r:2 w:2)191 // Storage: Common CollectionById (r:0 w:1)192 fn create_collection() -> Weight {193 (23_803_000 as Weight)194 .saturating_add(RocksDbWeight::get().reads(4 as Weight))195 .saturating_add(RocksDbWeight::get().writes(4 as Weight))196 }197 // Storage: Common CollectionById (r:1 w:1)198 // Storage: Common DestroyedCollectionCount (r:1 w:1)199 // Storage: Nonfungible TokensMinted (r:0 w:1)200 // Storage: Nonfungible TokensBurnt (r:0 w:1)201 fn destroy_collection() -> Weight {202 (27_831_000 as Weight)203 .saturating_add(RocksDbWeight::get().reads(2 as Weight))204 .saturating_add(RocksDbWeight::get().writes(4 as Weight))205 }206 // Storage: Common CollectionById (r:1 w:0)207 // Storage: Common Allowlist (r:0 w:1)208 fn add_to_white_list() -> Weight {209 (6_629_000 as Weight)210 .saturating_add(RocksDbWeight::get().reads(1 as Weight))211 .saturating_add(RocksDbWeight::get().writes(1 as Weight))212 }213 // Storage: Common CollectionById (r:1 w:0)214 // Storage: Common Allowlist (r:0 w:1)215 fn remove_from_white_list() -> Weight {216 (6_596_000 as Weight)217 .saturating_add(RocksDbWeight::get().reads(1 as Weight))218 .saturating_add(RocksDbWeight::get().writes(1 as Weight))219 }220 // Storage: Common CollectionById (r:1 w:1)221 fn set_public_access_mode() -> Weight {222 (6_338_000 as Weight)223 .saturating_add(RocksDbWeight::get().reads(1 as Weight))224 .saturating_add(RocksDbWeight::get().writes(1 as Weight))225 }226 // Storage: Common CollectionById (r:1 w:1)227 fn set_mint_permission() -> Weight {228 (6_383_000 as Weight)229 .saturating_add(RocksDbWeight::get().reads(1 as Weight))230 .saturating_add(RocksDbWeight::get().writes(1 as Weight))231 }232 // Storage: Common CollectionById (r:1 w:1)233 fn change_collection_owner() -> Weight {234 (6_493_000 as Weight)235 .saturating_add(RocksDbWeight::get().reads(1 as Weight))236 .saturating_add(RocksDbWeight::get().writes(1 as Weight))237 }238 // Storage: Common CollectionById (r:1 w:0)239 // Storage: Common IsAdmin (r:0 w:1)240 fn add_collection_admin() -> Weight {241 (6_850_000 as Weight)242 .saturating_add(RocksDbWeight::get().reads(1 as Weight))243 .saturating_add(RocksDbWeight::get().writes(1 as Weight))244 }245 // Storage: Common CollectionById (r:1 w:0)246 // Storage: Common IsAdmin (r:0 w:1)247 fn remove_collection_admin() -> Weight {248 (6_615_000 as Weight)249 .saturating_add(RocksDbWeight::get().reads(1 as Weight))250 .saturating_add(RocksDbWeight::get().writes(1 as Weight))251 }252 // Storage: Common CollectionById (r:1 w:1)253 fn set_collection_sponsor() -> Weight {254 (6_430_000 as Weight)255 .saturating_add(RocksDbWeight::get().reads(1 as Weight))256 .saturating_add(RocksDbWeight::get().writes(1 as Weight))257 }258 // Storage: Common CollectionById (r:1 w:1)259 fn confirm_sponsorship() -> Weight {260 (6_125_000 as Weight)261 .saturating_add(RocksDbWeight::get().reads(1 as Weight))262 .saturating_add(RocksDbWeight::get().writes(1 as Weight))263 }264 // Storage: Common CollectionById (r:1 w:1)265 fn remove_collection_sponsor() -> Weight {266 (6_236_000 as Weight)267 .saturating_add(RocksDbWeight::get().reads(1 as Weight))268 .saturating_add(RocksDbWeight::get().writes(1 as Weight))269 }270 // Storage: Common CollectionById (r:1 w:1)271 fn set_transfers_enabled_flag() -> Weight {272 (6_500_000 as Weight)273 .saturating_add(RocksDbWeight::get().reads(1 as Weight))274 .saturating_add(RocksDbWeight::get().writes(1 as Weight))275 }276 // Storage: Common CollectionById (r:1 w:1)277 fn set_offchain_schema(_b: u32, ) -> Weight {278 (6_538_000 as Weight)279 .saturating_add(RocksDbWeight::get().reads(1 as Weight))280 .saturating_add(RocksDbWeight::get().writes(1 as Weight))281 }282 // Storage: Common CollectionById (r:1 w:1)283 fn set_const_on_chain_schema(_b: u32, ) -> Weight {284 (6_542_000 as Weight)285 .saturating_add(RocksDbWeight::get().reads(1 as Weight))286 .saturating_add(RocksDbWeight::get().writes(1 as Weight))287 }288 // Storage: Common CollectionById (r:1 w:1)289 fn set_variable_on_chain_schema(b: u32, ) -> Weight {290 (6_092_000 as Weight)291 // Standard Error: 0292 .saturating_add((2_000 as Weight).saturating_mul(b as Weight))293 .saturating_add(RocksDbWeight::get().reads(1 as Weight))294 .saturating_add(RocksDbWeight::get().writes(1 as Weight))295 }296 // Storage: Common CollectionById (r:1 w:1)297 fn set_schema_version() -> Weight {298 (6_470_000 as Weight)299 .saturating_add(RocksDbWeight::get().reads(1 as Weight))300 .saturating_add(RocksDbWeight::get().writes(1 as Weight))301 }302 // Storage: Common CollectionById (r:1 w:1)303 fn set_collection_limits() -> Weight {304 (6_841_000 as Weight)305 .saturating_add(RocksDbWeight::get().reads(1 as Weight))306 .saturating_add(RocksDbWeight::get().writes(1 as Weight))307 }308 // Storage: Common CollectionById (r:1 w:1)309 fn set_meta_update_permission_flag() -> Weight {310 (6_278_000 as Weight)311 .saturating_add(RocksDbWeight::get().reads(1 as Weight))312 .saturating_add(RocksDbWeight::get().writes(1 as Weight))313 }314}