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

difftreelog

source

pallets/nonfungible/src/weights.rs9.7 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 set_property_permissions(amount: u32) -> Weight;42	fn transfer() -> Weight;43	fn approve() -> Weight;44	fn transfer_from() -> Weight;45	fn burn_from() -> Weight;46	fn set_variable_metadata(b: u32, ) -> Weight;47}4849/// Weights for pallet_nonfungible using the Substrate node and recommended hardware.50pub struct SubstrateWeight<T>(PhantomData<T>);51impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {52	// Storage: Nonfungible TokensMinted (r:1 w:1)53	// Storage: Nonfungible AccountBalance (r:1 w:1)54	// Storage: Nonfungible TokenData (r:0 w:1)55	// Storage: Nonfungible Owned (r:0 w:1)56	fn create_item() -> Weight {57		(18_450_000 as Weight)58			.saturating_add(T::DbWeight::get().reads(2 as Weight))59			.saturating_add(T::DbWeight::get().writes(4 as Weight))60	}61	// Storage: Nonfungible TokensMinted (r:1 w:1)62	// Storage: Nonfungible AccountBalance (r:1 w:1)63	// Storage: Nonfungible TokenData (r:0 w:4)64	// Storage: Nonfungible Owned (r:0 w:4)65	fn create_multiple_items(b: u32, ) -> Weight {66		(10_228_000 as Weight)67			// Standard Error: 1_00068			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))69			.saturating_add(T::DbWeight::get().reads(2 as Weight))70			.saturating_add(T::DbWeight::get().writes(2 as Weight))71			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))72	}73	// Storage: Nonfungible TokensMinted (r:1 w:1)74	// Storage: Nonfungible AccountBalance (r:4 w:4)75	// Storage: Nonfungible TokenData (r:0 w:4)76	// Storage: Nonfungible Owned (r:0 w:4)77	fn create_multiple_items_ex(b: u32, ) -> Weight {78		(6_543_000 as Weight)79			// Standard Error: 2_00080			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))81			.saturating_add(T::DbWeight::get().reads(1 as Weight))82			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))83			.saturating_add(T::DbWeight::get().writes(1 as Weight))84			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))85	}86	// Storage: Nonfungible TokenData (r:1 w:1)87	// Storage: Nonfungible TokensBurnt (r:1 w:1)88	// Storage: Nonfungible AccountBalance (r:1 w:1)89	// Storage: Nonfungible Allowance (r:1 w:0)90	// Storage: Nonfungible Owned (r:0 w:1)91	fn burn_item() -> Weight {92		(24_554_000 as Weight)93			.saturating_add(T::DbWeight::get().reads(4 as Weight))94			.saturating_add(T::DbWeight::get().writes(4 as Weight))95	}9697	fn set_collection_properties(amount: u32) -> Weight {98		// TODO calculate appropriate weight99		(50_000_000 as Weight).saturating_mul(amount as Weight)100	}101102	fn set_token_properties(amount: u32) -> Weight {103		// TODO calculate appropriate weight104		(50_000_000 as Weight).saturating_mul(amount as Weight)105	}106107	fn set_property_permissions(amount: u32) -> Weight {108		// TODO calculate appropriate weight109		(50_000_000 as Weight).saturating_mul(amount as Weight)110	}111112	// Storage: Nonfungible TokenData (r:1 w:1)113	// Storage: Nonfungible AccountBalance (r:2 w:2)114	// Storage: Nonfungible Allowance (r:1 w:0)115	// Storage: Nonfungible Owned (r:0 w:2)116	fn transfer() -> Weight {117		(28_339_000 as Weight)118			.saturating_add(T::DbWeight::get().reads(4 as Weight))119			.saturating_add(T::DbWeight::get().writes(5 as Weight))120	}121	// Storage: Nonfungible TokenData (r:1 w:0)122	// Storage: Nonfungible Allowance (r:1 w:1)123	fn approve() -> Weight {124		(17_616_000 as Weight)125			.saturating_add(T::DbWeight::get().reads(2 as Weight))126			.saturating_add(T::DbWeight::get().writes(1 as Weight))127	}128	// Storage: Nonfungible Allowance (r:1 w:1)129	// Storage: Nonfungible TokenData (r:1 w:1)130	// Storage: Nonfungible AccountBalance (r:2 w:2)131	// Storage: Nonfungible Owned (r:0 w:2)132	fn transfer_from() -> Weight {133		(32_196_000 as Weight)134			.saturating_add(T::DbWeight::get().reads(4 as Weight))135			.saturating_add(T::DbWeight::get().writes(6 as Weight))136	}137	// Storage: Nonfungible Allowance (r:1 w:1)138	// Storage: Nonfungible TokenData (r:1 w:1)139	// Storage: Nonfungible TokensBurnt (r:1 w:1)140	// Storage: Nonfungible AccountBalance (r:1 w:1)141	// Storage: Nonfungible Owned (r:0 w:1)142	fn burn_from() -> Weight {143		(27_580_000 as Weight)144			.saturating_add(T::DbWeight::get().reads(4 as Weight))145			.saturating_add(T::DbWeight::get().writes(5 as Weight))146	}147	// Storage: Nonfungible TokenData (r:1 w:1)148	fn set_variable_metadata(_b: u32, ) -> Weight {149		(7_700_000 as Weight)150			.saturating_add(T::DbWeight::get().reads(1 as Weight))151			.saturating_add(T::DbWeight::get().writes(1 as Weight))152	}153}154155// For backwards compatibility and tests156impl WeightInfo for () {157	// Storage: Nonfungible TokensMinted (r:1 w:1)158	// Storage: Nonfungible AccountBalance (r:1 w:1)159	// Storage: Nonfungible TokenData (r:0 w:1)160	// Storage: Nonfungible Owned (r:0 w:1)161	fn create_item() -> Weight {162		(18_450_000 as Weight)163			.saturating_add(RocksDbWeight::get().reads(2 as Weight))164			.saturating_add(RocksDbWeight::get().writes(4 as Weight))165	}166	// Storage: Nonfungible TokensMinted (r:1 w:1)167	// Storage: Nonfungible AccountBalance (r:1 w:1)168	// Storage: Nonfungible TokenData (r:0 w:4)169	// Storage: Nonfungible Owned (r:0 w:4)170	fn create_multiple_items(b: u32, ) -> Weight {171		(10_228_000 as Weight)172			// Standard Error: 1_000173			.saturating_add((4_392_000 as Weight).saturating_mul(b as Weight))174			.saturating_add(RocksDbWeight::get().reads(2 as Weight))175			.saturating_add(RocksDbWeight::get().writes(2 as Weight))176			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))177	}178	// Storage: Nonfungible TokensMinted (r:1 w:1)179	// Storage: Nonfungible AccountBalance (r:4 w:4)180	// Storage: Nonfungible TokenData (r:0 w:4)181	// Storage: Nonfungible Owned (r:0 w:4)182	fn create_multiple_items_ex(b: u32, ) -> Weight {183		(6_543_000 as Weight)184			// Standard Error: 2_000185			.saturating_add((7_175_000 as Weight).saturating_mul(b as Weight))186			.saturating_add(RocksDbWeight::get().reads(1 as Weight))187			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))188			.saturating_add(RocksDbWeight::get().writes(1 as Weight))189			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))190	}191	// Storage: Nonfungible TokenData (r:1 w:1)192	// Storage: Nonfungible TokensBurnt (r:1 w:1)193	// Storage: Nonfungible AccountBalance (r:1 w:1)194	// Storage: Nonfungible Allowance (r:1 w:0)195	// Storage: Nonfungible Owned (r:0 w:1)196	fn burn_item() -> Weight {197		(24_554_000 as Weight)198			.saturating_add(RocksDbWeight::get().reads(4 as Weight))199			.saturating_add(RocksDbWeight::get().writes(4 as Weight))200	}201202	fn set_collection_properties(amount: u32) -> Weight {203		// TODO calculate appropriate weight204		(50_000_000 as Weight).saturating_mul(amount as Weight)205	}206207	fn set_token_properties(amount: u32) -> Weight {208		// TODO calculate appropriate weight209		(50_000_000 as Weight).saturating_mul(amount as Weight)210	}211212	fn set_property_permissions(amount: u32) -> Weight {213		// TODO calculate appropriate weight214		(50_000_000 as Weight).saturating_mul(amount as Weight)215	}216217	// Storage: Nonfungible TokenData (r:1 w:1)218	// Storage: Nonfungible AccountBalance (r:2 w:2)219	// Storage: Nonfungible Allowance (r:1 w:0)220	// Storage: Nonfungible Owned (r:0 w:2)221	fn transfer() -> Weight {222		(28_339_000 as Weight)223			.saturating_add(RocksDbWeight::get().reads(4 as Weight))224			.saturating_add(RocksDbWeight::get().writes(5 as Weight))225	}226	// Storage: Nonfungible TokenData (r:1 w:0)227	// Storage: Nonfungible Allowance (r:1 w:1)228	fn approve() -> Weight {229		(17_616_000 as Weight)230			.saturating_add(RocksDbWeight::get().reads(2 as Weight))231			.saturating_add(RocksDbWeight::get().writes(1 as Weight))232	}233	// Storage: Nonfungible Allowance (r:1 w:1)234	// Storage: Nonfungible TokenData (r:1 w:1)235	// Storage: Nonfungible AccountBalance (r:2 w:2)236	// Storage: Nonfungible Owned (r:0 w:2)237	fn transfer_from() -> Weight {238		(32_196_000 as Weight)239			.saturating_add(RocksDbWeight::get().reads(4 as Weight))240			.saturating_add(RocksDbWeight::get().writes(6 as Weight))241	}242	// Storage: Nonfungible Allowance (r:1 w:1)243	// Storage: Nonfungible TokenData (r:1 w:1)244	// Storage: Nonfungible TokensBurnt (r:1 w:1)245	// Storage: Nonfungible AccountBalance (r:1 w:1)246	// Storage: Nonfungible Owned (r:0 w:1)247	fn burn_from() -> Weight {248		(27_580_000 as Weight)249			.saturating_add(RocksDbWeight::get().reads(4 as Weight))250			.saturating_add(RocksDbWeight::get().writes(5 as Weight))251	}252	// Storage: Nonfungible TokenData (r:1 w:1)253	fn set_variable_metadata(_b: u32, ) -> Weight {254		(7_700_000 as Weight)255			.saturating_add(RocksDbWeight::get().reads(1 as Weight))256			.saturating_add(RocksDbWeight::get().writes(1 as Weight))257	}258}