git.delta.rocks / unique-network / refs/commits / 9322aa344eaa

difftreelog

source

pallets/nonfungible/src/weights.rs9.3 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 change_collection_properties(amount: u32) -> Weight;40	fn change_token_properties(amount: u32) -> Weight;41	fn transfer() -> Weight;42	fn approve() -> Weight;43	fn transfer_from() -> Weight;44	fn burn_from() -> Weight;45	fn set_variable_metadata(b: u32, ) -> Weight;46}4748/// Weights for pallet_nonfungible using the Substrate node and recommended hardware.49pub struct SubstrateWeight<T>(PhantomData<T>);50impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {51	// Storage: Nonfungible TokensMinted (r:1 w:1)52	// Storage: Nonfungible AccountBalance (r:1 w:1)53	// Storage: Nonfungible TokenData (r:0 w:1)54	// Storage: Nonfungible Owned (r:0 w:1)55	fn create_item() -> Weight {56		(18_450_000 as Weight)57			.saturating_add(T::DbWeight::get().reads(2 as Weight))58			.saturating_add(T::DbWeight::get().writes(4 as Weight))59	}60	// Storage: Nonfungible TokensMinted (r:1 w:1)61	// Storage: Nonfungible AccountBalance (r:1 w:1)62	// Storage: Nonfungible TokenData (r:0 w:4)63	// Storage: Nonfungible Owned (r:0 w:4)64	fn create_multiple_items(b: u32, ) -> Weight {65		(10_228_000 as Weight)66			// Standard Error: 1_00067			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))68			.saturating_add(T::DbWeight::get().reads(2 as Weight))69			.saturating_add(T::DbWeight::get().writes(2 as Weight))70			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))71	}72	// Storage: Nonfungible TokensMinted (r:1 w:1)73	// Storage: Nonfungible AccountBalance (r:4 w:4)74	// Storage: Nonfungible TokenData (r:0 w:4)75	// Storage: Nonfungible Owned (r:0 w:4)76	fn create_multiple_items_ex(b: u32, ) -> Weight {77		(6_543_000 as Weight)78			// Standard Error: 2_00079			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))80			.saturating_add(T::DbWeight::get().reads(1 as Weight))81			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))82			.saturating_add(T::DbWeight::get().writes(1 as Weight))83			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))84	}85	// Storage: Nonfungible TokenData (r:1 w:1)86	// Storage: Nonfungible TokensBurnt (r:1 w:1)87	// Storage: Nonfungible AccountBalance (r:1 w:1)88	// Storage: Nonfungible Allowance (r:1 w:0)89	// Storage: Nonfungible Owned (r:0 w:1)90	fn burn_item() -> Weight {91		(24_554_000 as Weight)92			.saturating_add(T::DbWeight::get().reads(4 as Weight))93			.saturating_add(T::DbWeight::get().writes(4 as Weight))94	}9596	fn change_collection_properties(amount: u32) -> Weight {97		// TODO calculate appropriate weight98		(50_000_000 as Weight).saturating_mul(amount as Weight)99	}100101	fn change_token_properties(amount: u32) -> Weight {102		// TODO calculate appropriate weight103		(50_000_000 as Weight).saturating_mul(amount as Weight)104	}105106	// Storage: Nonfungible TokenData (r:1 w:1)107	// Storage: Nonfungible AccountBalance (r:2 w:2)108	// Storage: Nonfungible Allowance (r:1 w:0)109	// Storage: Nonfungible Owned (r:0 w:2)110	fn transfer() -> Weight {111		(28_339_000 as Weight)112			.saturating_add(T::DbWeight::get().reads(4 as Weight))113			.saturating_add(T::DbWeight::get().writes(5 as Weight))114	}115	// Storage: Nonfungible TokenData (r:1 w:0)116	// Storage: Nonfungible Allowance (r:1 w:1)117	fn approve() -> Weight {118		(17_616_000 as Weight)119			.saturating_add(T::DbWeight::get().reads(2 as Weight))120			.saturating_add(T::DbWeight::get().writes(1 as Weight))121	}122	// Storage: Nonfungible Allowance (r:1 w:1)123	// Storage: Nonfungible TokenData (r:1 w:1)124	// Storage: Nonfungible AccountBalance (r:2 w:2)125	// Storage: Nonfungible Owned (r:0 w:2)126	fn transfer_from() -> Weight {127		(32_196_000 as Weight)128			.saturating_add(T::DbWeight::get().reads(4 as Weight))129			.saturating_add(T::DbWeight::get().writes(6 as Weight))130	}131	// Storage: Nonfungible Allowance (r:1 w:1)132	// Storage: Nonfungible TokenData (r:1 w:1)133	// Storage: Nonfungible TokensBurnt (r:1 w:1)134	// Storage: Nonfungible AccountBalance (r:1 w:1)135	// Storage: Nonfungible Owned (r:0 w:1)136	fn burn_from() -> Weight {137		(27_580_000 as Weight)138			.saturating_add(T::DbWeight::get().reads(4 as Weight))139			.saturating_add(T::DbWeight::get().writes(5 as Weight))140	}141	// Storage: Nonfungible TokenData (r:1 w:1)142	fn set_variable_metadata(_b: u32, ) -> Weight {143		(7_700_000 as Weight)144			.saturating_add(T::DbWeight::get().reads(1 as Weight))145			.saturating_add(T::DbWeight::get().writes(1 as Weight))146	}147}148149// For backwards compatibility and tests150impl WeightInfo for () {151	// Storage: Nonfungible TokensMinted (r:1 w:1)152	// Storage: Nonfungible AccountBalance (r:1 w:1)153	// Storage: Nonfungible TokenData (r:0 w:1)154	// Storage: Nonfungible Owned (r:0 w:1)155	fn create_item() -> Weight {156		(18_450_000 as Weight)157			.saturating_add(RocksDbWeight::get().reads(2 as Weight))158			.saturating_add(RocksDbWeight::get().writes(4 as Weight))159	}160	// Storage: Nonfungible TokensMinted (r:1 w:1)161	// Storage: Nonfungible AccountBalance (r:1 w:1)162	// Storage: Nonfungible TokenData (r:0 w:4)163	// Storage: Nonfungible Owned (r:0 w:4)164	fn create_multiple_items(b: u32, ) -> Weight {165		(10_228_000 as Weight)166			// Standard Error: 1_000167			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))168			.saturating_add(RocksDbWeight::get().reads(2 as Weight))169			.saturating_add(RocksDbWeight::get().writes(2 as Weight))170			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))171	}172	// Storage: Nonfungible TokensMinted (r:1 w:1)173	// Storage: Nonfungible AccountBalance (r:4 w:4)174	// Storage: Nonfungible TokenData (r:0 w:4)175	// Storage: Nonfungible Owned (r:0 w:4)176	fn create_multiple_items_ex(b: u32, ) -> Weight {177		(6_543_000 as Weight)178			// Standard Error: 2_000179			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))180			.saturating_add(RocksDbWeight::get().reads(1 as Weight))181			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))182			.saturating_add(RocksDbWeight::get().writes(1 as Weight))183			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))184	}185	// Storage: Nonfungible TokenData (r:1 w:1)186	// Storage: Nonfungible TokensBurnt (r:1 w:1)187	// Storage: Nonfungible AccountBalance (r:1 w:1)188	// Storage: Nonfungible Allowance (r:1 w:0)189	// Storage: Nonfungible Owned (r:0 w:1)190	fn burn_item() -> Weight {191		(24_554_000 as Weight)192			.saturating_add(RocksDbWeight::get().reads(4 as Weight))193			.saturating_add(RocksDbWeight::get().writes(4 as Weight))194	}195196	fn change_collection_properties(amount: u32) -> Weight {197		// TODO calculate appropriate weight198		(50_000_000 as Weight).saturating_mul(amount as Weight)199	}200201	fn change_token_properties(amount: u32) -> Weight {202		// TODO calculate appropriate weight203		(50_000_000 as Weight).saturating_mul(amount as Weight)204	}205206	// Storage: Nonfungible TokenData (r:1 w:1)207	// Storage: Nonfungible AccountBalance (r:2 w:2)208	// Storage: Nonfungible Allowance (r:1 w:0)209	// Storage: Nonfungible Owned (r:0 w:2)210	fn transfer() -> Weight {211		(28_339_000 as Weight)212			.saturating_add(RocksDbWeight::get().reads(4 as Weight))213			.saturating_add(RocksDbWeight::get().writes(5 as Weight))214	}215	// Storage: Nonfungible TokenData (r:1 w:0)216	// Storage: Nonfungible Allowance (r:1 w:1)217	fn approve() -> Weight {218		(17_616_000 as Weight)219			.saturating_add(RocksDbWeight::get().reads(2 as Weight))220			.saturating_add(RocksDbWeight::get().writes(1 as Weight))221	}222	// Storage: Nonfungible Allowance (r:1 w:1)223	// Storage: Nonfungible TokenData (r:1 w:1)224	// Storage: Nonfungible AccountBalance (r:2 w:2)225	// Storage: Nonfungible Owned (r:0 w:2)226	fn transfer_from() -> Weight {227		(32_196_000 as Weight)228			.saturating_add(RocksDbWeight::get().reads(4 as Weight))229			.saturating_add(RocksDbWeight::get().writes(6 as Weight))230	}231	// Storage: Nonfungible Allowance (r:1 w:1)232	// Storage: Nonfungible TokenData (r:1 w:1)233	// Storage: Nonfungible TokensBurnt (r:1 w:1)234	// Storage: Nonfungible AccountBalance (r:1 w:1)235	// Storage: Nonfungible Owned (r:0 w:1)236	fn burn_from() -> Weight {237		(27_580_000 as Weight)238			.saturating_add(RocksDbWeight::get().reads(4 as Weight))239			.saturating_add(RocksDbWeight::get().writes(5 as Weight))240	}241	// Storage: Nonfungible TokenData (r:1 w:1)242	fn set_variable_metadata(_b: u32, ) -> Weight {243		(7_700_000 as Weight)244			.saturating_add(RocksDbWeight::get().reads(1 as Weight))245			.saturating_add(RocksDbWeight::get().writes(1 as Weight))246	}247}