git.delta.rocks / unique-network / refs/commits / aa3d2ae73e39

difftreelog

source

pallets/nonfungible/src/weights.rs10.0 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 set_token_properties(amount: u32) -> Weight;41	fn delete_token_properties(amount: u32) -> Weight;42	fn set_property_permissions(amount: u32) -> Weight;43	fn transfer() -> Weight;44	fn approve() -> Weight;45	fn transfer_from() -> Weight;46	fn burn_from() -> Weight;47	fn set_variable_metadata(b: u32, ) -> Weight;48}4950/// Weights for pallet_nonfungible using the Substrate node and recommended hardware.51pub struct SubstrateWeight<T>(PhantomData<T>);52impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {53	// Storage: Nonfungible TokensMinted (r:1 w:1)54	// Storage: Nonfungible AccountBalance (r:1 w:1)55	// Storage: Nonfungible TokenData (r:0 w:1)56	// Storage: Nonfungible Owned (r:0 w:1)57	fn create_item() -> Weight {58		(18_450_000 as Weight)59			.saturating_add(T::DbWeight::get().reads(2 as Weight))60			.saturating_add(T::DbWeight::get().writes(4 as Weight))61	}62	// Storage: Nonfungible TokensMinted (r:1 w:1)63	// Storage: Nonfungible AccountBalance (r:1 w:1)64	// Storage: Nonfungible TokenData (r:0 w:4)65	// Storage: Nonfungible Owned (r:0 w:4)66	fn create_multiple_items(b: u32, ) -> Weight {67		(10_228_000 as Weight)68			// Standard Error: 1_00069			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))70			.saturating_add(T::DbWeight::get().reads(2 as Weight))71			.saturating_add(T::DbWeight::get().writes(2 as Weight))72			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))73	}74	// Storage: Nonfungible TokensMinted (r:1 w:1)75	// Storage: Nonfungible AccountBalance (r:4 w:4)76	// Storage: Nonfungible TokenData (r:0 w:4)77	// Storage: Nonfungible Owned (r:0 w:4)78	fn create_multiple_items_ex(b: u32, ) -> Weight {79		(6_543_000 as Weight)80			// Standard Error: 2_00081			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))82			.saturating_add(T::DbWeight::get().reads(1 as Weight))83			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))84			.saturating_add(T::DbWeight::get().writes(1 as Weight))85			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))86	}87	// Storage: Nonfungible TokenData (r:1 w:1)88	// Storage: Nonfungible TokensBurnt (r:1 w:1)89	// Storage: Nonfungible AccountBalance (r:1 w:1)90	// Storage: Nonfungible Allowance (r:1 w:0)91	// Storage: Nonfungible Owned (r:0 w:1)92	fn burn_item() -> Weight {93		(24_554_000 as Weight)94			.saturating_add(T::DbWeight::get().reads(4 as Weight))95			.saturating_add(T::DbWeight::get().writes(4 as Weight))96	}9798	fn set_collection_properties(amount: u32) -> Weight {99		// TODO calculate appropriate weight100		(50_000_000 as Weight).saturating_mul(amount as Weight)101	}102103	fn set_token_properties(amount: u32) -> Weight {104		// TODO calculate appropriate weight105		(50_000_000 as Weight).saturating_mul(amount as Weight)106	}107108	fn delete_token_properties(amount: u32) -> Weight {109		// TODO calculate appropriate weight110		(50_000_000 as Weight).saturating_mul(amount as Weight)111	}112113	fn set_property_permissions(amount: u32) -> Weight {114		// TODO calculate appropriate weight115		(50_000_000 as Weight).saturating_mul(amount as Weight)116	}117118	// Storage: Nonfungible TokenData (r:1 w:1)119	// Storage: Nonfungible AccountBalance (r:2 w:2)120	// Storage: Nonfungible Allowance (r:1 w:0)121	// Storage: Nonfungible Owned (r:0 w:2)122	fn transfer() -> Weight {123		(28_339_000 as Weight)124			.saturating_add(T::DbWeight::get().reads(4 as Weight))125			.saturating_add(T::DbWeight::get().writes(5 as Weight))126	}127	// Storage: Nonfungible TokenData (r:1 w:0)128	// Storage: Nonfungible Allowance (r:1 w:1)129	fn approve() -> Weight {130		(17_616_000 as Weight)131			.saturating_add(T::DbWeight::get().reads(2 as Weight))132			.saturating_add(T::DbWeight::get().writes(1 as Weight))133	}134	// Storage: Nonfungible Allowance (r:1 w:1)135	// Storage: Nonfungible TokenData (r:1 w:1)136	// Storage: Nonfungible AccountBalance (r:2 w:2)137	// Storage: Nonfungible Owned (r:0 w:2)138	fn transfer_from() -> Weight {139		(32_196_000 as Weight)140			.saturating_add(T::DbWeight::get().reads(4 as Weight))141			.saturating_add(T::DbWeight::get().writes(6 as Weight))142	}143	// Storage: Nonfungible Allowance (r:1 w:1)144	// Storage: Nonfungible TokenData (r:1 w:1)145	// Storage: Nonfungible TokensBurnt (r:1 w:1)146	// Storage: Nonfungible AccountBalance (r:1 w:1)147	// Storage: Nonfungible Owned (r:0 w:1)148	fn burn_from() -> Weight {149		(27_580_000 as Weight)150			.saturating_add(T::DbWeight::get().reads(4 as Weight))151			.saturating_add(T::DbWeight::get().writes(5 as Weight))152	}153	// Storage: Nonfungible TokenData (r:1 w:1)154	fn set_variable_metadata(_b: u32, ) -> Weight {155		(7_700_000 as Weight)156			.saturating_add(T::DbWeight::get().reads(1 as Weight))157			.saturating_add(T::DbWeight::get().writes(1 as Weight))158	}159}160161// For backwards compatibility and tests162impl WeightInfo for () {163	// Storage: Nonfungible TokensMinted (r:1 w:1)164	// Storage: Nonfungible AccountBalance (r:1 w:1)165	// Storage: Nonfungible TokenData (r:0 w:1)166	// Storage: Nonfungible Owned (r:0 w:1)167	fn create_item() -> Weight {168		(18_450_000 as Weight)169			.saturating_add(RocksDbWeight::get().reads(2 as Weight))170			.saturating_add(RocksDbWeight::get().writes(4 as Weight))171	}172	// Storage: Nonfungible TokensMinted (r:1 w:1)173	// Storage: Nonfungible AccountBalance (r:1 w:1)174	// Storage: Nonfungible TokenData (r:0 w:4)175	// Storage: Nonfungible Owned (r:0 w:4)176	fn create_multiple_items(b: u32, ) -> Weight {177		(10_228_000 as Weight)178			// Standard Error: 1_000179			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))180			.saturating_add(RocksDbWeight::get().reads(2 as Weight))181			.saturating_add(RocksDbWeight::get().writes(2 as Weight))182			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))183	}184	// Storage: Nonfungible TokensMinted (r:1 w:1)185	// Storage: Nonfungible AccountBalance (r:4 w:4)186	// Storage: Nonfungible TokenData (r:0 w:4)187	// Storage: Nonfungible Owned (r:0 w:4)188	fn create_multiple_items_ex(b: u32, ) -> Weight {189		(6_543_000 as Weight)190			// Standard Error: 2_000191			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))192			.saturating_add(RocksDbWeight::get().reads(1 as Weight))193			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))194			.saturating_add(RocksDbWeight::get().writes(1 as Weight))195			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))196	}197	// Storage: Nonfungible TokenData (r:1 w:1)198	// Storage: Nonfungible TokensBurnt (r:1 w:1)199	// Storage: Nonfungible AccountBalance (r:1 w:1)200	// Storage: Nonfungible Allowance (r:1 w:0)201	// Storage: Nonfungible Owned (r:0 w:1)202	fn burn_item() -> Weight {203		(24_554_000 as Weight)204			.saturating_add(RocksDbWeight::get().reads(4 as Weight))205			.saturating_add(RocksDbWeight::get().writes(4 as Weight))206	}207208	fn set_collection_properties(amount: u32) -> Weight {209		// TODO calculate appropriate weight210		(50_000_000 as Weight).saturating_mul(amount as Weight)211	}212213	fn set_token_properties(amount: u32) -> Weight {214		// TODO calculate appropriate weight215		(50_000_000 as Weight).saturating_mul(amount as Weight)216	}217218	fn delete_token_properties(amount: u32) -> Weight {219		// TODO calculate appropriate weight220		(50_000_000 as Weight).saturating_mul(amount as Weight)221	}222223	fn set_property_permissions(amount: u32) -> Weight {224		// TODO calculate appropriate weight225		(50_000_000 as Weight).saturating_mul(amount as Weight)226	}227228	// Storage: Nonfungible TokenData (r:1 w:1)229	// Storage: Nonfungible AccountBalance (r:2 w:2)230	// Storage: Nonfungible Allowance (r:1 w:0)231	// Storage: Nonfungible Owned (r:0 w:2)232	fn transfer() -> Weight {233		(28_339_000 as Weight)234			.saturating_add(RocksDbWeight::get().reads(4 as Weight))235			.saturating_add(RocksDbWeight::get().writes(5 as Weight))236	}237	// Storage: Nonfungible TokenData (r:1 w:0)238	// Storage: Nonfungible Allowance (r:1 w:1)239	fn approve() -> Weight {240		(17_616_000 as Weight)241			.saturating_add(RocksDbWeight::get().reads(2 as Weight))242			.saturating_add(RocksDbWeight::get().writes(1 as Weight))243	}244	// Storage: Nonfungible Allowance (r:1 w:1)245	// Storage: Nonfungible TokenData (r:1 w:1)246	// Storage: Nonfungible AccountBalance (r:2 w:2)247	// Storage: Nonfungible Owned (r:0 w:2)248	fn transfer_from() -> Weight {249		(32_196_000 as Weight)250			.saturating_add(RocksDbWeight::get().reads(4 as Weight))251			.saturating_add(RocksDbWeight::get().writes(6 as Weight))252	}253	// Storage: Nonfungible Allowance (r:1 w:1)254	// Storage: Nonfungible TokenData (r:1 w:1)255	// Storage: Nonfungible TokensBurnt (r:1 w:1)256	// Storage: Nonfungible AccountBalance (r:1 w:1)257	// Storage: Nonfungible Owned (r:0 w:1)258	fn burn_from() -> Weight {259		(27_580_000 as Weight)260			.saturating_add(RocksDbWeight::get().reads(4 as Weight))261			.saturating_add(RocksDbWeight::get().writes(5 as Weight))262	}263	// Storage: Nonfungible TokenData (r:1 w:1)264	fn set_variable_metadata(_b: u32, ) -> Weight {265		(7_700_000 as Weight)266			.saturating_add(RocksDbWeight::get().reads(1 as Weight))267			.saturating_add(RocksDbWeight::get().writes(1 as Weight))268	}269}