pallet_passkey/
weights.rs

1
2//! Autogenerated weights for `pallet_passkey`
3//!
4//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
5//! DATE: 2025-08-20, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
6//! WORST CASE MAP SIZE: `1000000`
7//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
8//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
9
10// Executed Command:
11// ./scripts/../target/release/frequency
12// benchmark
13// pallet
14// --pallet=pallet_passkey
15// --extrinsic
16// *
17// --heap-pages=4096
18// --steps=20
19// --repeat=10
20// --output=./scripts/../pallets/passkey/src/weights.rs
21// --template=./scripts/../.maintain/frame-weight-template.hbs
22// --additional-trie-layers=3
23// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
24// --genesis-builder=runtime
25
26#![cfg_attr(rustfmt, rustfmt_skip)]
27#![allow(unused_parens)]
28#![allow(unused_imports)]
29#![allow(missing_docs)]
30
31use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
32use core::marker::PhantomData;
33
34/// Weight functions needed for `pallet_passkey`.
35pub trait WeightInfo {
36	fn validate() -> Weight;
37	fn pre_dispatch() -> Weight;
38}
39
40/// Weights for `pallet_passkey` using the Substrate node and recommended hardware.
41pub struct SubstrateWeight<T>(PhantomData<T>);
42impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
43	/// Storage: `System::BlockHash` (r:1 w:0)
44	/// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
45	/// Storage: `System::Account` (r:1 w:0)
46	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
47	fn validate() -> Weight {
48		// Proof Size summary in bytes:
49		//  Measured:  `170`
50		//  Estimated: `4088`
51		// Minimum execution time: 1_795_434_000 picoseconds.
52		Weight::from_parts(1_823_414_000, 4088)
53			.saturating_add(T::DbWeight::get().reads(2_u64))
54	}
55	/// Storage: `System::Account` (r:1 w:1)
56	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
57	fn pre_dispatch() -> Weight {
58		// Proof Size summary in bytes:
59		//  Measured:  `140`
60		//  Estimated: `4088`
61		// Minimum execution time: 1_822_342_000 picoseconds.
62		Weight::from_parts(1_830_190_000, 4088)
63			.saturating_add(T::DbWeight::get().reads(1_u64))
64			.saturating_add(T::DbWeight::get().writes(1_u64))
65	}
66}
67
68// For backwards compatibility and tests.
69impl WeightInfo for () {
70	/// Storage: `System::BlockHash` (r:1 w:0)
71	/// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
72	/// Storage: `System::Account` (r:1 w:0)
73	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
74	fn validate() -> Weight {
75		// Proof Size summary in bytes:
76		//  Measured:  `170`
77		//  Estimated: `4088`
78		// Minimum execution time: 1_795_434_000 picoseconds.
79		Weight::from_parts(1_823_414_000, 4088)
80			.saturating_add(RocksDbWeight::get().reads(2_u64))
81	}
82	/// Storage: `System::Account` (r:1 w:1)
83	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
84	fn pre_dispatch() -> Weight {
85		// Proof Size summary in bytes:
86		//  Measured:  `140`
87		//  Estimated: `4088`
88		// Minimum execution time: 1_822_342_000 picoseconds.
89		Weight::from_parts(1_830_190_000, 4088)
90			.saturating_add(RocksDbWeight::get().reads(1_u64))
91			.saturating_add(RocksDbWeight::get().writes(1_u64))
92	}
93}
94
95
96#[cfg(test)]
97mod tests {
98  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
99  use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
100  use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;
101
102  #[allow(dead_code)]
103  struct BlockWeights;
104  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
105  	fn get() -> frame_system::limits::BlockWeights {
106  		frame_system::limits::BlockWeights::builder()
107  			.base_block(Weight::zero())
108  			.for_class(DispatchClass::all(), |weights| {
109  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
110  			})
111  			.for_class(DispatchClass::non_mandatory(), |weights| {
112  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
113  			})
114  			.build_or_panic()
115  	}
116  }
117
118	#[test]
119	fn test_validate() {
120		assert!(
121			BlockWeights::get()
122				.per_class
123				.get(frame_support::dispatch::DispatchClass::Normal)
124				.max_extrinsic
125				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
126				.proof_size()
127				> 4088
128		);
129	}
130	#[test]
131	fn test_pre_dispatch() {
132		assert!(
133			BlockWeights::get()
134				.per_class
135				.get(frame_support::dispatch::DispatchClass::Normal)
136				.max_extrinsic
137				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
138				.proof_size()
139				> 4088
140		);
141	}
142}