git.delta.rocks / unique-network / refs/commits / 6ac8e66dbab7

difftreelog

source

pallets/nonfungible/src/weights.rs10.4 KiBsourcehistory
1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs23//! Autogenerated weights for pallet_nonfungible4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev6//! DATE: 2022-03-01, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 102489// Executed Command:10// target/release/unique-collator11// benchmark12// --pallet13// pallet-nonfungible14// --wasm-execution15// compiled16// --extrinsic17// *18// --template19// .maintain/frame-weight-template.hbs20// --steps=5021// --repeat=20022// --heap-pages=409623// --output=./pallets/nonfungible/src/weights.rs2425#![cfg_attr(rustfmt, rustfmt_skip)]26#![allow(unused_parens)]27#![allow(unused_imports)]28#![allow(clippy::unnecessary_cast)]2930use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};31use sp_std::marker::PhantomData;3233/// Weight functions needed for pallet_nonfungible.34pub trait WeightInfo {35	fn create_item() -> Weight;36	fn create_multiple_items(b: u32, ) -> Weight;37	fn create_multiple_items_ex(b: u32, ) -> Weight;38	fn burn_item() -> Weight;39	fn set_collection_properties(amount: u32) -> Weight;40	fn delete_collection_properties(amount: u32) -> Weight;41	fn set_token_properties(amount: u32) -> Weight;42	fn delete_token_properties(amount: u32) -> Weight;43	fn set_property_permissions(amount: u32) -> Weight;44	fn transfer() -> Weight;45	fn approve() -> Weight;46	fn transfer_from() -> Weight;47	fn burn_from() -> Weight;48	fn set_variable_metadata(b: u32, ) -> Weight;49}5051/// Weights for pallet_nonfungible using the Substrate node and recommended hardware.52pub struct SubstrateWeight<T>(PhantomData<T>);53impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {54	// Storage: Nonfungible TokensMinted (r:1 w:1)55	// Storage: Nonfungible AccountBalance (r:1 w:1)56	// Storage: Nonfungible TokenData (r:0 w:1)57	// Storage: Nonfungible Owned (r:0 w:1)58	fn create_item() -> Weight {59		(18_450_000 as Weight)60			.saturating_add(T::DbWeight::get().reads(2 as Weight))61			.saturating_add(T::DbWeight::get().writes(4 as Weight))62	}63	// Storage: Nonfungible TokensMinted (r:1 w:1)64	// Storage: Nonfungible AccountBalance (r:1 w:1)65	// Storage: Nonfungible TokenData (r:0 w:4)66	// Storage: Nonfungible Owned (r:0 w:4)67	fn create_multiple_items(b: u32, ) -> Weight {68		(10_228_000 as Weight)69			// Standard Error: 1_00070			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))71			.saturating_add(T::DbWeight::get().reads(2 as Weight))72			.saturating_add(T::DbWeight::get().writes(2 as Weight))73			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))74	}75	// Storage: Nonfungible TokensMinted (r:1 w:1)76	// Storage: Nonfungible AccountBalance (r:4 w:4)77	// Storage: Nonfungible TokenData (r:0 w:4)78	// Storage: Nonfungible Owned (r:0 w:4)79	fn create_multiple_items_ex(b: u32, ) -> Weight {80		(6_543_000 as Weight)81			// Standard Error: 2_00082			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))83			.saturating_add(T::DbWeight::get().reads(1 as Weight))84			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))85			.saturating_add(T::DbWeight::get().writes(1 as Weight))86			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))87	}88	// Storage: Nonfungible TokenData (r:1 w:1)89	// Storage: Nonfungible TokensBurnt (r:1 w:1)90	// Storage: Nonfungible AccountBalance (r:1 w:1)91	// Storage: Nonfungible Allowance (r:1 w:0)92	// Storage: Nonfungible Owned (r:0 w:1)93	fn burn_item() -> Weight {94		(24_554_000 as Weight)95			.saturating_add(T::DbWeight::get().reads(4 as Weight))96			.saturating_add(T::DbWeight::get().writes(4 as Weight))97	}9899	fn set_collection_properties(amount: u32) -> Weight {100		// TODO calculate appropriate weight101		(50_000_000 as Weight).saturating_mul(amount as Weight)102	}103104	fn delete_collection_properties(amount: u32) -> Weight {105		// TODO calculate appropriate weight106		(50_000_000 as Weight).saturating_mul(amount as Weight)107	}108109	fn set_token_properties(amount: u32) -> Weight {110		// TODO calculate appropriate weight111		(50_000_000 as Weight).saturating_mul(amount as Weight)112	}113114	fn delete_token_properties(amount: u32) -> Weight {115		// TODO calculate appropriate weight116		(50_000_000 as Weight).saturating_mul(amount as Weight)117	}118119	fn set_property_permissions(amount: u32) -> Weight {120		// TODO calculate appropriate weight121		(50_000_000 as Weight).saturating_mul(amount as Weight)122	}123124	// Storage: Nonfungible TokenData (r:1 w:1)125	// Storage: Nonfungible AccountBalance (r:2 w:2)126	// Storage: Nonfungible Allowance (r:1 w:0)127	// Storage: Nonfungible Owned (r:0 w:2)128	fn transfer() -> Weight {129		(28_339_000 as Weight)130			.saturating_add(T::DbWeight::get().reads(4 as Weight))131			.saturating_add(T::DbWeight::get().writes(5 as Weight))132	}133	// Storage: Nonfungible TokenData (r:1 w:0)134	// Storage: Nonfungible Allowance (r:1 w:1)135	fn approve() -> Weight {136		(17_616_000 as Weight)137			.saturating_add(T::DbWeight::get().reads(2 as Weight))138			.saturating_add(T::DbWeight::get().writes(1 as Weight))139	}140	// Storage: Nonfungible Allowance (r:1 w:1)141	// Storage: Nonfungible TokenData (r:1 w:1)142	// Storage: Nonfungible AccountBalance (r:2 w:2)143	// Storage: Nonfungible Owned (r:0 w:2)144	fn transfer_from() -> Weight {145		(32_196_000 as Weight)146			.saturating_add(T::DbWeight::get().reads(4 as Weight))147			.saturating_add(T::DbWeight::get().writes(6 as Weight))148	}149	// Storage: Nonfungible Allowance (r:1 w:1)150	// Storage: Nonfungible TokenData (r:1 w:1)151	// Storage: Nonfungible TokensBurnt (r:1 w:1)152	// Storage: Nonfungible AccountBalance (r:1 w:1)153	// Storage: Nonfungible Owned (r:0 w:1)154	fn burn_from() -> Weight {155		(27_580_000 as Weight)156			.saturating_add(T::DbWeight::get().reads(4 as Weight))157			.saturating_add(T::DbWeight::get().writes(5 as Weight))158	}159	// Storage: Nonfungible TokenData (r:1 w:1)160	fn set_variable_metadata(_b: u32, ) -> Weight {161		(7_700_000 as Weight)162			.saturating_add(T::DbWeight::get().reads(1 as Weight))163			.saturating_add(T::DbWeight::get().writes(1 as Weight))164	}165}166167// For backwards compatibility and tests168impl WeightInfo for () {169	// Storage: Nonfungible TokensMinted (r:1 w:1)170	// Storage: Nonfungible AccountBalance (r:1 w:1)171	// Storage: Nonfungible TokenData (r:0 w:1)172	// Storage: Nonfungible Owned (r:0 w:1)173	fn create_item() -> Weight {174		(18_450_000 as Weight)175			.saturating_add(RocksDbWeight::get().reads(2 as Weight))176			.saturating_add(RocksDbWeight::get().writes(4 as Weight))177	}178	// Storage: Nonfungible TokensMinted (r:1 w:1)179	// Storage: Nonfungible AccountBalance (r:1 w:1)180	// Storage: Nonfungible TokenData (r:0 w:4)181	// Storage: Nonfungible Owned (r:0 w:4)182	fn create_multiple_items(b: u32, ) -> Weight {183		(10_228_000 as Weight)184			// Standard Error: 1_000185			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))186			.saturating_add(RocksDbWeight::get().reads(2 as Weight))187			.saturating_add(RocksDbWeight::get().writes(2 as Weight))188			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))189	}190	// Storage: Nonfungible TokensMinted (r:1 w:1)191	// Storage: Nonfungible AccountBalance (r:4 w:4)192	// Storage: Nonfungible TokenData (r:0 w:4)193	// Storage: Nonfungible Owned (r:0 w:4)194	fn create_multiple_items_ex(b: u32, ) -> Weight {195		(6_543_000 as Weight)196			// Standard Error: 2_000197			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))198			.saturating_add(RocksDbWeight::get().reads(1 as Weight))199			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))200			.saturating_add(RocksDbWeight::get().writes(1 as Weight))201			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))202	}203	// Storage: Nonfungible TokenData (r:1 w:1)204	// Storage: Nonfungible TokensBurnt (r:1 w:1)205	// Storage: Nonfungible AccountBalance (r:1 w:1)206	// Storage: Nonfungible Allowance (r:1 w:0)207	// Storage: Nonfungible Owned (r:0 w:1)208	fn burn_item() -> Weight {209		(24_554_000 as Weight)210			.saturating_add(RocksDbWeight::get().reads(4 as Weight))211			.saturating_add(RocksDbWeight::get().writes(4 as Weight))212	}213214	fn set_collection_properties(amount: u32) -> Weight {215		// TODO calculate appropriate weight216		(50_000_000 as Weight).saturating_mul(amount as Weight)217	}218219	fn delete_collection_properties(amount: u32) -> Weight {220		// TODO calculate appropriate weight221		(50_000_000 as Weight).saturating_mul(amount as Weight)222	}223224	fn set_token_properties(amount: u32) -> Weight {225		// TODO calculate appropriate weight226		(50_000_000 as Weight).saturating_mul(amount as Weight)227	}228229	fn delete_token_properties(amount: u32) -> Weight {230		// TODO calculate appropriate weight231		(50_000_000 as Weight).saturating_mul(amount as Weight)232	}233234	fn set_property_permissions(amount: u32) -> Weight {235		// TODO calculate appropriate weight236		(50_000_000 as Weight).saturating_mul(amount as Weight)237	}238239	// Storage: Nonfungible TokenData (r:1 w:1)240	// Storage: Nonfungible AccountBalance (r:2 w:2)241	// Storage: Nonfungible Allowance (r:1 w:0)242	// Storage: Nonfungible Owned (r:0 w:2)243	fn transfer() -> Weight {244		(28_339_000 as Weight)245			.saturating_add(RocksDbWeight::get().reads(4 as Weight))246			.saturating_add(RocksDbWeight::get().writes(5 as Weight))247	}248	// Storage: Nonfungible TokenData (r:1 w:0)249	// Storage: Nonfungible Allowance (r:1 w:1)250	fn approve() -> Weight {251		(17_616_000 as Weight)252			.saturating_add(RocksDbWeight::get().reads(2 as Weight))253			.saturating_add(RocksDbWeight::get().writes(1 as Weight))254	}255	// Storage: Nonfungible Allowance (r:1 w:1)256	// Storage: Nonfungible TokenData (r:1 w:1)257	// Storage: Nonfungible AccountBalance (r:2 w:2)258	// Storage: Nonfungible Owned (r:0 w:2)259	fn transfer_from() -> Weight {260		(32_196_000 as Weight)261			.saturating_add(RocksDbWeight::get().reads(4 as Weight))262			.saturating_add(RocksDbWeight::get().writes(6 as Weight))263	}264	// Storage: Nonfungible Allowance (r:1 w:1)265	// Storage: Nonfungible TokenData (r:1 w:1)266	// Storage: Nonfungible TokensBurnt (r:1 w:1)267	// Storage: Nonfungible AccountBalance (r:1 w:1)268	// Storage: Nonfungible Owned (r:0 w:1)269	fn burn_from() -> Weight {270		(27_580_000 as Weight)271			.saturating_add(RocksDbWeight::get().reads(4 as Weight))272			.saturating_add(RocksDbWeight::get().writes(5 as Weight))273	}274	// Storage: Nonfungible TokenData (r:1 w:1)275	fn set_variable_metadata(_b: u32, ) -> Weight {276		(7_700_000 as Weight)277			.saturating_add(RocksDbWeight::get().reads(1 as Weight))278			.saturating_add(RocksDbWeight::get().writes(1 as Weight))279	}280}