git.delta.rocks / unique-network / refs/commits / 87c401906db8

difftreelog

feat bench bulk mints

Yaroslav Bolyukin2021-08-31parent: #c2620ab.patch.diff
in: master

2 files changed

modifiedpallets/nft/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -162,6 +162,16 @@
 		});
 	}: 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);
@@ -171,6 +181,14 @@
 		});
 	}: 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);
@@ -184,6 +202,16 @@
 		});
 	}: 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())?;
@@ -215,6 +243,11 @@
 		<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())?;
modifiedpallets/nft/src/weights.rsdiffbeforeafterboth
before · pallets/nft/src/weights.rs
1// 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 3.0.06//! DATE: 2021-08-30, 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 create_item_nft(b: u32, ) -> Weight;47	fn create_item_fungible() -> Weight;48	fn create_item_refungible(b: u32, ) -> Weight;49	fn burn_item_nft() -> Weight;50	fn transfer_nft() -> Weight;51	fn transfer_fungible() -> Weight;52	fn transfer_refungible() -> Weight;53	fn approve_nft() -> Weight;54	fn transfer_from_nft() -> Weight;55	fn transfer_from_fungible() -> Weight;56	fn transfer_from_refungible() -> Weight;57	fn set_offchain_schema(b: u32, ) -> Weight;58	fn set_const_on_chain_schema(b: u32, ) -> Weight;59	fn set_variable_on_chain_schema(b: u32, ) -> Weight;60	fn set_variable_meta_data_nft(b: u32, ) -> Weight;61	fn set_schema_version() -> Weight;62	fn set_collection_limits() -> Weight;63}6465/// Weights for pallet_nft using the Substrate node and recommended hardware.66pub struct SubstrateWeight<T>(PhantomData<T>);67impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {68	fn create_collection() -> Weight {69		(25_851_000 as Weight)70			.saturating_add(T::DbWeight::get().reads(8 as Weight))71			.saturating_add(T::DbWeight::get().writes(6 as Weight))72	}73	fn destroy_collection() -> Weight {74		(28_737_000 as Weight)75			.saturating_add(T::DbWeight::get().reads(2 as Weight))76			.saturating_add(T::DbWeight::get().writes(4 as Weight))77	}78	fn add_to_white_list() -> Weight {79		(6_237_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	fn remove_from_white_list() -> Weight {84		(6_252_000 as Weight)85			.saturating_add(T::DbWeight::get().reads(1 as Weight))86			.saturating_add(T::DbWeight::get().writes(1 as Weight))87	}88	fn set_public_access_mode() -> Weight {89		(6_691_000 as Weight)90			.saturating_add(T::DbWeight::get().reads(1 as Weight))91			.saturating_add(T::DbWeight::get().writes(1 as Weight))92	}93	fn set_mint_permission() -> Weight {94		(6_630_000 as Weight)95			.saturating_add(T::DbWeight::get().reads(1 as Weight))96			.saturating_add(T::DbWeight::get().writes(1 as Weight))97	}98	fn change_collection_owner() -> Weight {99		(6_521_000 as Weight)100			.saturating_add(T::DbWeight::get().reads(1 as Weight))101			.saturating_add(T::DbWeight::get().writes(1 as Weight))102	}103	fn add_collection_admin() -> Weight {104		(8_057_000 as Weight)105			.saturating_add(T::DbWeight::get().reads(2 as Weight))106			.saturating_add(T::DbWeight::get().writes(1 as Weight))107	}108	fn remove_collection_admin() -> Weight {109		(8_307_000 as Weight)110			.saturating_add(T::DbWeight::get().reads(2 as Weight))111			.saturating_add(T::DbWeight::get().writes(1 as Weight))112	}113	fn set_collection_sponsor() -> Weight {114		(6_484_000 as Weight)115			.saturating_add(T::DbWeight::get().reads(1 as Weight))116			.saturating_add(T::DbWeight::get().writes(1 as Weight))117	}118	fn confirm_sponsorship() -> Weight {119		(6_530_000 as Weight)120			.saturating_add(T::DbWeight::get().reads(1 as Weight))121			.saturating_add(T::DbWeight::get().writes(1 as Weight))122	}123	fn remove_collection_sponsor() -> Weight {124		(6_733_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	fn create_item_nft(_b: u32, ) -> Weight {129		(167_909_000 as Weight)130			.saturating_add(T::DbWeight::get().reads(11 as Weight))131			.saturating_add(T::DbWeight::get().writes(8 as Weight))132	}133	fn create_item_fungible() -> Weight {134		(22_331_000 as Weight)135			.saturating_add(T::DbWeight::get().reads(9 as Weight))136			.saturating_add(T::DbWeight::get().writes(4 as Weight))137	}138	fn create_item_refungible(_b: u32, ) -> Weight {139		(26_293_000 as Weight)140			.saturating_add(T::DbWeight::get().reads(9 as Weight))141			.saturating_add(T::DbWeight::get().writes(7 as Weight))142	}143	fn burn_item_nft() -> Weight {144		(32_237_000 as Weight)145			.saturating_add(T::DbWeight::get().reads(9 as Weight))146			.saturating_add(T::DbWeight::get().writes(7 as Weight))147	}148	fn transfer_nft() -> Weight {149		(192_578_000 as Weight)150			.saturating_add(T::DbWeight::get().reads(14 as Weight))151			.saturating_add(T::DbWeight::get().writes(10 as Weight))152	}153	fn transfer_fungible() -> Weight {154		(170_749_000 as Weight)155			.saturating_add(T::DbWeight::get().reads(11 as Weight))156			.saturating_add(T::DbWeight::get().writes(7 as Weight))157	}158	fn transfer_refungible() -> Weight {159		(35_949_000 as Weight)160			.saturating_add(T::DbWeight::get().reads(10 as Weight))161			.saturating_add(T::DbWeight::get().writes(7 as Weight))162	}163	fn approve_nft() -> Weight {164		(169_825_000 as Weight)165			.saturating_add(T::DbWeight::get().reads(9 as Weight))166			.saturating_add(T::DbWeight::get().writes(4 as Weight))167	}168	fn transfer_from_nft() -> Weight {169		(197_912_000 as Weight)170			.saturating_add(T::DbWeight::get().reads(15 as Weight))171			.saturating_add(T::DbWeight::get().writes(11 as Weight))172	}173	fn transfer_from_fungible() -> Weight {174		(183_789_000 as Weight)175			.saturating_add(T::DbWeight::get().reads(12 as Weight))176			.saturating_add(T::DbWeight::get().writes(8 as Weight))177	}178	fn transfer_from_refungible() -> Weight {179		(37_149_000 as Weight)180			.saturating_add(T::DbWeight::get().reads(11 as Weight))181			.saturating_add(T::DbWeight::get().writes(8 as Weight))182	}183	fn set_offchain_schema(_b: u32, ) -> Weight {184		(6_435_000 as Weight)185			.saturating_add(T::DbWeight::get().reads(1 as Weight))186			.saturating_add(T::DbWeight::get().writes(1 as Weight))187	}188	fn set_const_on_chain_schema(_b: u32, ) -> Weight {189		(6_646_000 as Weight)190			.saturating_add(T::DbWeight::get().reads(1 as Weight))191			.saturating_add(T::DbWeight::get().writes(1 as Weight))192	}193	fn set_variable_on_chain_schema(_b: u32, ) -> Weight {194		(6_542_000 as Weight)195			.saturating_add(T::DbWeight::get().reads(1 as Weight))196			.saturating_add(T::DbWeight::get().writes(1 as Weight))197	}198	fn set_variable_meta_data_nft(_b: u32, ) -> Weight {199		(14_697_000 as Weight)200			.saturating_add(T::DbWeight::get().reads(2 as Weight))201			.saturating_add(T::DbWeight::get().writes(1 as Weight))202	}203	fn set_schema_version() -> Weight {204		(6_566_000 as Weight)205			.saturating_add(T::DbWeight::get().reads(1 as Weight))206			.saturating_add(T::DbWeight::get().writes(1 as Weight))207	}208	fn set_collection_limits() -> Weight {209		(6_349_000 as Weight)210			.saturating_add(T::DbWeight::get().reads(1 as Weight))211			.saturating_add(T::DbWeight::get().writes(1 as Weight))212	}213}214215// For backwards compatibility and tests216impl WeightInfo for () {217	fn create_collection() -> Weight {218		(25_851_000 as Weight)219			.saturating_add(RocksDbWeight::get().reads(8 as Weight))220			.saturating_add(RocksDbWeight::get().writes(6 as Weight))221	}222	fn destroy_collection() -> Weight {223		(28_737_000 as Weight)224			.saturating_add(RocksDbWeight::get().reads(2 as Weight))225			.saturating_add(RocksDbWeight::get().writes(4 as Weight))226	}227	fn add_to_white_list() -> Weight {228		(6_237_000 as Weight)229			.saturating_add(RocksDbWeight::get().reads(1 as Weight))230			.saturating_add(RocksDbWeight::get().writes(1 as Weight))231	}232	fn remove_from_white_list() -> Weight {233		(6_252_000 as Weight)234			.saturating_add(RocksDbWeight::get().reads(1 as Weight))235			.saturating_add(RocksDbWeight::get().writes(1 as Weight))236	}237	fn set_public_access_mode() -> Weight {238		(6_691_000 as Weight)239			.saturating_add(RocksDbWeight::get().reads(1 as Weight))240			.saturating_add(RocksDbWeight::get().writes(1 as Weight))241	}242	fn set_mint_permission() -> Weight {243		(6_630_000 as Weight)244			.saturating_add(RocksDbWeight::get().reads(1 as Weight))245			.saturating_add(RocksDbWeight::get().writes(1 as Weight))246	}247	fn change_collection_owner() -> Weight {248		(6_521_000 as Weight)249			.saturating_add(RocksDbWeight::get().reads(1 as Weight))250			.saturating_add(RocksDbWeight::get().writes(1 as Weight))251	}252	fn add_collection_admin() -> Weight {253		(8_057_000 as Weight)254			.saturating_add(RocksDbWeight::get().reads(2 as Weight))255			.saturating_add(RocksDbWeight::get().writes(1 as Weight))256	}257	fn remove_collection_admin() -> Weight {258		(8_307_000 as Weight)259			.saturating_add(RocksDbWeight::get().reads(2 as Weight))260			.saturating_add(RocksDbWeight::get().writes(1 as Weight))261	}262	fn set_collection_sponsor() -> Weight {263		(6_484_000 as Weight)264			.saturating_add(RocksDbWeight::get().reads(1 as Weight))265			.saturating_add(RocksDbWeight::get().writes(1 as Weight))266	}267	fn confirm_sponsorship() -> Weight {268		(6_530_000 as Weight)269			.saturating_add(RocksDbWeight::get().reads(1 as Weight))270			.saturating_add(RocksDbWeight::get().writes(1 as Weight))271	}272	fn remove_collection_sponsor() -> Weight {273		(6_733_000 as Weight)274			.saturating_add(RocksDbWeight::get().reads(1 as Weight))275			.saturating_add(RocksDbWeight::get().writes(1 as Weight))276	}277	fn create_item_nft(_b: u32, ) -> Weight {278		(167_909_000 as Weight)279			.saturating_add(RocksDbWeight::get().reads(11 as Weight))280			.saturating_add(RocksDbWeight::get().writes(8 as Weight))281	}282	fn create_item_fungible() -> Weight {283		(22_331_000 as Weight)284			.saturating_add(RocksDbWeight::get().reads(9 as Weight))285			.saturating_add(RocksDbWeight::get().writes(4 as Weight))286	}287	fn create_item_refungible(_b: u32, ) -> Weight {288		(26_293_000 as Weight)289			.saturating_add(RocksDbWeight::get().reads(9 as Weight))290			.saturating_add(RocksDbWeight::get().writes(7 as Weight))291	}292	fn burn_item_nft() -> Weight {293		(32_237_000 as Weight)294			.saturating_add(RocksDbWeight::get().reads(9 as Weight))295			.saturating_add(RocksDbWeight::get().writes(7 as Weight))296	}297	fn transfer_nft() -> Weight {298		(192_578_000 as Weight)299			.saturating_add(RocksDbWeight::get().reads(14 as Weight))300			.saturating_add(RocksDbWeight::get().writes(10 as Weight))301	}302	fn transfer_fungible() -> Weight {303		(170_749_000 as Weight)304			.saturating_add(RocksDbWeight::get().reads(11 as Weight))305			.saturating_add(RocksDbWeight::get().writes(7 as Weight))306	}307	fn transfer_refungible() -> Weight {308		(35_949_000 as Weight)309			.saturating_add(RocksDbWeight::get().reads(10 as Weight))310			.saturating_add(RocksDbWeight::get().writes(7 as Weight))311	}312	fn approve_nft() -> Weight {313		(169_825_000 as Weight)314			.saturating_add(RocksDbWeight::get().reads(9 as Weight))315			.saturating_add(RocksDbWeight::get().writes(4 as Weight))316	}317	fn transfer_from_nft() -> Weight {318		(197_912_000 as Weight)319			.saturating_add(RocksDbWeight::get().reads(15 as Weight))320			.saturating_add(RocksDbWeight::get().writes(11 as Weight))321	}322	fn transfer_from_fungible() -> Weight {323		(183_789_000 as Weight)324			.saturating_add(RocksDbWeight::get().reads(12 as Weight))325			.saturating_add(RocksDbWeight::get().writes(8 as Weight))326	}327	fn transfer_from_refungible() -> Weight {328		(37_149_000 as Weight)329			.saturating_add(RocksDbWeight::get().reads(11 as Weight))330			.saturating_add(RocksDbWeight::get().writes(8 as Weight))331	}332	fn set_offchain_schema(_b: u32, ) -> Weight {333		(6_435_000 as Weight)334			.saturating_add(RocksDbWeight::get().reads(1 as Weight))335			.saturating_add(RocksDbWeight::get().writes(1 as Weight))336	}337	fn set_const_on_chain_schema(_b: u32, ) -> Weight {338		(6_646_000 as Weight)339			.saturating_add(RocksDbWeight::get().reads(1 as Weight))340			.saturating_add(RocksDbWeight::get().writes(1 as Weight))341	}342	fn set_variable_on_chain_schema(_b: u32, ) -> Weight {343		(6_542_000 as Weight)344			.saturating_add(RocksDbWeight::get().reads(1 as Weight))345			.saturating_add(RocksDbWeight::get().writes(1 as Weight))346	}347	fn set_variable_meta_data_nft(_b: u32, ) -> Weight {348		(14_697_000 as Weight)349			.saturating_add(RocksDbWeight::get().reads(2 as Weight))350			.saturating_add(RocksDbWeight::get().writes(1 as Weight))351	}352	fn set_schema_version() -> Weight {353		(6_566_000 as Weight)354			.saturating_add(RocksDbWeight::get().reads(1 as Weight))355			.saturating_add(RocksDbWeight::get().writes(1 as Weight))356	}357	fn set_collection_limits() -> Weight {358		(6_349_000 as Weight)359			.saturating_add(RocksDbWeight::get().reads(1 as Weight))360			.saturating_add(RocksDbWeight::get().writes(1 as Weight))361	}362}
after · pallets/nft/src/weights.rs
1// 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 3.0.06//! DATE: 2021-08-31, 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 create_item_nft(b: u32, ) -> Weight;47	fn create_multiple_items_nft(b: u32, ) -> Weight;48	fn create_item_fungible() -> Weight;49	fn create_multiple_items_fungible(b: u32, ) -> Weight;50	fn create_item_refungible(b: u32, ) -> Weight;51	fn create_multiple_items_refungible(b: u32, ) -> Weight;52	fn burn_item_nft() -> Weight;53	fn transfer_nft() -> Weight;54	fn transfer_fungible() -> Weight;55	fn transfer_refungible() -> Weight;56	fn set_transfers_enabled_flag() -> Weight;57	fn approve_nft() -> Weight;58	fn transfer_from_nft() -> Weight;59	fn transfer_from_fungible() -> Weight;60	fn transfer_from_refungible() -> Weight;61	fn set_offchain_schema(b: u32, ) -> Weight;62	fn set_const_on_chain_schema(b: u32, ) -> Weight;63	fn set_variable_on_chain_schema(b: u32, ) -> Weight;64	fn set_variable_meta_data_nft(b: u32, ) -> Weight;65	fn set_schema_version() -> Weight;66	fn set_collection_limits() -> Weight;67}6869/// Weights for pallet_nft using the Substrate node and recommended hardware.70pub struct SubstrateWeight<T>(PhantomData<T>);71impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {72	fn create_collection() -> Weight {73		(25_851_000 as Weight)74			.saturating_add(T::DbWeight::get().reads(8 as Weight))75			.saturating_add(T::DbWeight::get().writes(6 as Weight))76	}77	fn destroy_collection() -> Weight {78		(28_737_000 as Weight)79			.saturating_add(T::DbWeight::get().reads(2 as Weight))80			.saturating_add(T::DbWeight::get().writes(4 as Weight))81	}82	fn add_to_white_list() -> Weight {83		(6_237_000 as Weight)84			.saturating_add(T::DbWeight::get().reads(1 as Weight))85			.saturating_add(T::DbWeight::get().writes(1 as Weight))86	}87	fn remove_from_white_list() -> Weight {88		(6_252_000 as Weight)89			.saturating_add(T::DbWeight::get().reads(1 as Weight))90			.saturating_add(T::DbWeight::get().writes(1 as Weight))91	}92	fn set_public_access_mode() -> Weight {93		(6_691_000 as Weight)94			.saturating_add(T::DbWeight::get().reads(1 as Weight))95			.saturating_add(T::DbWeight::get().writes(1 as Weight))96	}97	fn set_mint_permission() -> Weight {98		(6_630_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	fn change_collection_owner() -> Weight {103		(6_521_000 as Weight)104			.saturating_add(T::DbWeight::get().reads(1 as Weight))105			.saturating_add(T::DbWeight::get().writes(1 as Weight))106	}107	fn add_collection_admin() -> Weight {108		(8_057_000 as Weight)109			.saturating_add(T::DbWeight::get().reads(2 as Weight))110			.saturating_add(T::DbWeight::get().writes(1 as Weight))111	}112	fn remove_collection_admin() -> Weight {113		(8_307_000 as Weight)114			.saturating_add(T::DbWeight::get().reads(2 as Weight))115			.saturating_add(T::DbWeight::get().writes(1 as Weight))116	}117	fn set_collection_sponsor() -> Weight {118		(6_484_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	fn confirm_sponsorship() -> Weight {123		(6_530_000 as Weight)124			.saturating_add(T::DbWeight::get().reads(1 as Weight))125			.saturating_add(T::DbWeight::get().writes(1 as Weight))126	}127	fn remove_collection_sponsor() -> Weight {128		(6_733_000 as Weight)129			.saturating_add(T::DbWeight::get().reads(1 as Weight))130			.saturating_add(T::DbWeight::get().writes(1 as Weight))131	}132	fn create_item_nft(_b: u32, ) -> Weight {133		(167_909_000 as Weight)134			.saturating_add(T::DbWeight::get().reads(11 as Weight))135			.saturating_add(T::DbWeight::get().writes(8 as Weight))136	}137	fn create_multiple_items_nft(b: u32, ) -> Weight {138		(336_830_000 as Weight)139			// Standard Error: 42_000140			.saturating_add((11_627_000 as Weight).saturating_mul(b as Weight))141			.saturating_add(T::DbWeight::get().reads(11 as Weight))142			.saturating_add(T::DbWeight::get().writes(7 as Weight))143			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))144	}145	fn create_item_fungible() -> Weight {146		(24_123_000 as Weight)147			.saturating_add(T::DbWeight::get().reads(9 as Weight))148			.saturating_add(T::DbWeight::get().writes(4 as Weight))149	}150	fn create_multiple_items_fungible(b: u32, ) -> Weight {151		(48_227_000 as Weight)152			// Standard Error: 13_000153			.saturating_add((2_918_000 as Weight).saturating_mul(b as Weight))154			.saturating_add(T::DbWeight::get().reads(9 as Weight))155			.saturating_add(T::DbWeight::get().writes(4 as Weight))156	}157	fn create_item_refungible(_b: u32, ) -> Weight {158		(26_293_000 as Weight)159			.saturating_add(T::DbWeight::get().reads(9 as Weight))160			.saturating_add(T::DbWeight::get().writes(7 as Weight))161	}162	fn create_multiple_items_refungible(b: u32, ) -> Weight {163		(0 as Weight)164			// Standard Error: 16_000165			.saturating_add((8_374_000 as Weight).saturating_mul(b as Weight))166			.saturating_add(T::DbWeight::get().reads(9 as Weight))167			.saturating_add(T::DbWeight::get().writes(6 as Weight))168			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))169	}170	fn burn_item_nft() -> Weight {171		(32_237_000 as Weight)172			.saturating_add(T::DbWeight::get().reads(9 as Weight))173			.saturating_add(T::DbWeight::get().writes(7 as Weight))174	}175	fn transfer_nft() -> Weight {176		(192_578_000 as Weight)177			.saturating_add(T::DbWeight::get().reads(14 as Weight))178			.saturating_add(T::DbWeight::get().writes(10 as Weight))179	}180	fn transfer_fungible() -> Weight {181		(170_749_000 as Weight)182			.saturating_add(T::DbWeight::get().reads(11 as Weight))183			.saturating_add(T::DbWeight::get().writes(7 as Weight))184	}185	fn transfer_refungible() -> Weight {186		(35_949_000 as Weight)187			.saturating_add(T::DbWeight::get().reads(10 as Weight))188			.saturating_add(T::DbWeight::get().writes(7 as Weight))189	}190	fn set_transfers_enabled_flag() -> Weight {191		(6_376_000 as Weight)192			.saturating_add(T::DbWeight::get().reads(1 as Weight))193			.saturating_add(T::DbWeight::get().writes(1 as Weight))194	}195	fn approve_nft() -> Weight {196		(169_825_000 as Weight)197			.saturating_add(T::DbWeight::get().reads(9 as Weight))198			.saturating_add(T::DbWeight::get().writes(4 as Weight))199	}200	fn transfer_from_nft() -> Weight {201		(197_912_000 as Weight)202			.saturating_add(T::DbWeight::get().reads(15 as Weight))203			.saturating_add(T::DbWeight::get().writes(11 as Weight))204	}205	fn transfer_from_fungible() -> Weight {206		(183_789_000 as Weight)207			.saturating_add(T::DbWeight::get().reads(12 as Weight))208			.saturating_add(T::DbWeight::get().writes(8 as Weight))209	}210	fn transfer_from_refungible() -> Weight {211		(37_149_000 as Weight)212			.saturating_add(T::DbWeight::get().reads(11 as Weight))213			.saturating_add(T::DbWeight::get().writes(8 as Weight))214	}215	fn set_offchain_schema(_b: u32, ) -> Weight {216		(6_435_000 as Weight)217			.saturating_add(T::DbWeight::get().reads(1 as Weight))218			.saturating_add(T::DbWeight::get().writes(1 as Weight))219	}220	fn set_const_on_chain_schema(_b: u32, ) -> Weight {221		(6_646_000 as Weight)222			.saturating_add(T::DbWeight::get().reads(1 as Weight))223			.saturating_add(T::DbWeight::get().writes(1 as Weight))224	}225	fn set_variable_on_chain_schema(_b: u32, ) -> Weight {226		(6_542_000 as Weight)227			.saturating_add(T::DbWeight::get().reads(1 as Weight))228			.saturating_add(T::DbWeight::get().writes(1 as Weight))229	}230	fn set_variable_meta_data_nft(_b: u32, ) -> Weight {231		(14_697_000 as Weight)232			.saturating_add(T::DbWeight::get().reads(2 as Weight))233			.saturating_add(T::DbWeight::get().writes(1 as Weight))234	}235	fn set_schema_version() -> Weight {236		(6_566_000 as Weight)237			.saturating_add(T::DbWeight::get().reads(1 as Weight))238			.saturating_add(T::DbWeight::get().writes(1 as Weight))239	}240	fn set_collection_limits() -> Weight {241		(6_349_000 as Weight)242			.saturating_add(T::DbWeight::get().reads(1 as Weight))243			.saturating_add(T::DbWeight::get().writes(1 as Weight))244	}245}246247// For backwards compatibility and tests248impl WeightInfo for () {249	fn create_collection() -> Weight {250		(25_851_000 as Weight)251			.saturating_add(RocksDbWeight::get().reads(8 as Weight))252			.saturating_add(RocksDbWeight::get().writes(6 as Weight))253	}254	fn destroy_collection() -> Weight {255		(28_737_000 as Weight)256			.saturating_add(RocksDbWeight::get().reads(2 as Weight))257			.saturating_add(RocksDbWeight::get().writes(4 as Weight))258	}259	fn add_to_white_list() -> Weight {260		(6_237_000 as Weight)261			.saturating_add(RocksDbWeight::get().reads(1 as Weight))262			.saturating_add(RocksDbWeight::get().writes(1 as Weight))263	}264	fn remove_from_white_list() -> Weight {265		(6_252_000 as Weight)266			.saturating_add(RocksDbWeight::get().reads(1 as Weight))267			.saturating_add(RocksDbWeight::get().writes(1 as Weight))268	}269	fn set_public_access_mode() -> Weight {270		(6_691_000 as Weight)271			.saturating_add(RocksDbWeight::get().reads(1 as Weight))272			.saturating_add(RocksDbWeight::get().writes(1 as Weight))273	}274	fn set_mint_permission() -> Weight {275		(6_630_000 as Weight)276			.saturating_add(RocksDbWeight::get().reads(1 as Weight))277			.saturating_add(RocksDbWeight::get().writes(1 as Weight))278	}279	fn change_collection_owner() -> Weight {280		(6_521_000 as Weight)281			.saturating_add(RocksDbWeight::get().reads(1 as Weight))282			.saturating_add(RocksDbWeight::get().writes(1 as Weight))283	}284	fn add_collection_admin() -> Weight {285		(8_057_000 as Weight)286			.saturating_add(RocksDbWeight::get().reads(2 as Weight))287			.saturating_add(RocksDbWeight::get().writes(1 as Weight))288	}289	fn remove_collection_admin() -> Weight {290		(8_307_000 as Weight)291			.saturating_add(RocksDbWeight::get().reads(2 as Weight))292			.saturating_add(RocksDbWeight::get().writes(1 as Weight))293	}294	fn set_collection_sponsor() -> Weight {295		(6_484_000 as Weight)296			.saturating_add(RocksDbWeight::get().reads(1 as Weight))297			.saturating_add(RocksDbWeight::get().writes(1 as Weight))298	}299	fn confirm_sponsorship() -> Weight {300		(6_530_000 as Weight)301			.saturating_add(RocksDbWeight::get().reads(1 as Weight))302			.saturating_add(RocksDbWeight::get().writes(1 as Weight))303	}304	fn remove_collection_sponsor() -> Weight {305		(6_733_000 as Weight)306			.saturating_add(RocksDbWeight::get().reads(1 as Weight))307			.saturating_add(RocksDbWeight::get().writes(1 as Weight))308	}309	fn create_item_nft(b: u32, ) -> Weight {310		(167_180_000 as Weight)311			// Standard Error: 1_000312			.saturating_add((10_000 as Weight).saturating_mul(b as Weight))313			.saturating_add(RocksDbWeight::get().reads(11 as Weight))314			.saturating_add(RocksDbWeight::get().writes(8 as Weight))315	}316	fn create_multiple_items_nft(b: u32, ) -> Weight {317		(336_830_000 as Weight)318			// Standard Error: 42_000319			.saturating_add((11_627_000 as Weight).saturating_mul(b as Weight))320			.saturating_add(RocksDbWeight::get().reads(11 as Weight))321			.saturating_add(RocksDbWeight::get().writes(7 as Weight))322			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))323	}324	fn create_item_fungible() -> Weight {325		(24_123_000 as Weight)326			.saturating_add(RocksDbWeight::get().reads(9 as Weight))327			.saturating_add(RocksDbWeight::get().writes(4 as Weight))328	}329	fn create_multiple_items_fungible(b: u32, ) -> Weight {330		(13_217_000 as Weight)331			// Standard Error: 4_000332			.saturating_add((2_971_000 as Weight).saturating_mul(b as Weight))333			.saturating_add(RocksDbWeight::get().reads(9 as Weight))334			.saturating_add(RocksDbWeight::get().writes(4 as Weight))335	}336	fn create_item_refungible(_b: u32, ) -> Weight {337		(26_293_000 as Weight)338			.saturating_add(RocksDbWeight::get().reads(9 as Weight))339			.saturating_add(RocksDbWeight::get().writes(7 as Weight))340	}341	fn create_multiple_items_refungible(b: u32, ) -> Weight {342		(0 as Weight)343			// Standard Error: 16_000344			.saturating_add((8_374_000 as Weight).saturating_mul(b as Weight))345			.saturating_add(RocksDbWeight::get().reads(9 as Weight))346			.saturating_add(RocksDbWeight::get().writes(6 as Weight))347			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))348	}349	fn burn_item_nft() -> Weight {350		(32_237_000 as Weight)351			.saturating_add(RocksDbWeight::get().reads(9 as Weight))352			.saturating_add(RocksDbWeight::get().writes(7 as Weight))353	}354	fn transfer_nft() -> Weight {355		(192_578_000 as Weight)356			.saturating_add(RocksDbWeight::get().reads(14 as Weight))357			.saturating_add(RocksDbWeight::get().writes(10 as Weight))358	}359	fn transfer_fungible() -> Weight {360		(170_749_000 as Weight)361			.saturating_add(RocksDbWeight::get().reads(11 as Weight))362			.saturating_add(RocksDbWeight::get().writes(7 as Weight))363	}364	fn transfer_refungible() -> Weight {365		(35_949_000 as Weight)366			.saturating_add(RocksDbWeight::get().reads(10 as Weight))367			.saturating_add(RocksDbWeight::get().writes(7 as Weight))368	}369	fn set_transfers_enabled_flag() -> Weight {370		(6_376_000 as Weight)371			.saturating_add(RocksDbWeight::get().reads(1 as Weight))372			.saturating_add(RocksDbWeight::get().writes(1 as Weight))373	}374	fn approve_nft() -> Weight {375		(169_825_000 as Weight)376			.saturating_add(RocksDbWeight::get().reads(9 as Weight))377			.saturating_add(RocksDbWeight::get().writes(4 as Weight))378	}379	fn transfer_from_nft() -> Weight {380		(197_912_000 as Weight)381			.saturating_add(RocksDbWeight::get().reads(15 as Weight))382			.saturating_add(RocksDbWeight::get().writes(11 as Weight))383	}384	fn transfer_from_fungible() -> Weight {385		(183_789_000 as Weight)386			.saturating_add(RocksDbWeight::get().reads(12 as Weight))387			.saturating_add(RocksDbWeight::get().writes(8 as Weight))388	}389	fn transfer_from_refungible() -> Weight {390		(37_149_000 as Weight)391			.saturating_add(RocksDbWeight::get().reads(11 as Weight))392			.saturating_add(RocksDbWeight::get().writes(8 as Weight))393	}394	fn set_offchain_schema(_b: u32, ) -> Weight {395		(6_435_000 as Weight)396			.saturating_add(RocksDbWeight::get().reads(1 as Weight))397			.saturating_add(RocksDbWeight::get().writes(1 as Weight))398	}399	fn set_const_on_chain_schema(_b: u32, ) -> Weight {400		(6_646_000 as Weight)401			.saturating_add(RocksDbWeight::get().reads(1 as Weight))402			.saturating_add(RocksDbWeight::get().writes(1 as Weight))403	}404	fn set_variable_on_chain_schema(_b: u32, ) -> Weight {405		(6_542_000 as Weight)406			.saturating_add(RocksDbWeight::get().reads(1 as Weight))407			.saturating_add(RocksDbWeight::get().writes(1 as Weight))408	}409	fn set_variable_meta_data_nft(_b: u32, ) -> Weight {410		(14_697_000 as Weight)411			.saturating_add(RocksDbWeight::get().reads(2 as Weight))412			.saturating_add(RocksDbWeight::get().writes(1 as Weight))413	}414	fn set_schema_version() -> Weight {415		(6_566_000 as Weight)416			.saturating_add(RocksDbWeight::get().reads(1 as Weight))417			.saturating_add(RocksDbWeight::get().writes(1 as Weight))418	}419	fn set_collection_limits() -> Weight {420		(6_349_000 as Weight)421			.saturating_add(RocksDbWeight::get().reads(1 as Weight))422			.saturating_add(RocksDbWeight::get().writes(1 as Weight))423	}424}