referrerpolicy=no-referrer-when-downgrade

pallet_lottery/
weights.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// 	http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_lottery`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_lottery
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/lottery/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_lottery`.
74pub trait WeightInfo {
75	fn buy_ticket() -> Weight;
76	fn set_calls(n: u32, ) -> Weight;
77	fn start_lottery() -> Weight;
78	fn stop_repeat() -> Weight;
79	fn on_initialize_end() -> Weight;
80	fn on_initialize_repeat() -> Weight;
81}
82
83/// Weights for `pallet_lottery` using the Substrate node and recommended hardware.
84pub struct SubstrateWeight<T>(PhantomData<T>);
85impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
86	/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
87	/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
88	/// Storage: `TxPause::PausedCalls` (r:1 w:0)
89	/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
90	/// Storage: `Lottery::Lottery` (r:1 w:0)
91	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
92	/// Storage: `Lottery::CallIndices` (r:1 w:0)
93	/// Proof: `Lottery::CallIndices` (`max_values`: Some(1), `max_size`: Some(21), added: 516, mode: `MaxEncodedLen`)
94	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
95	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
96	/// Storage: `Lottery::Participants` (r:1 w:1)
97	/// Proof: `Lottery::Participants` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
98	/// Storage: `Lottery::LotteryIndex` (r:1 w:0)
99	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
100	/// Storage: `System::Account` (r:1 w:1)
101	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
102	/// Storage: `Lottery::Tickets` (r:0 w:1)
103	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
104	fn buy_ticket() -> Weight {
105		// Proof Size summary in bytes:
106		//  Measured:  `289`
107		//  Estimated: `3997`
108		// Minimum execution time: 57_591_000 picoseconds.
109		Weight::from_parts(59_527_000, 3997)
110			.saturating_add(T::DbWeight::get().reads(8_u64))
111			.saturating_add(T::DbWeight::get().writes(4_u64))
112	}
113	/// Storage: `Lottery::CallIndices` (r:0 w:1)
114	/// Proof: `Lottery::CallIndices` (`max_values`: Some(1), `max_size`: Some(21), added: 516, mode: `MaxEncodedLen`)
115	/// The range of component `n` is `[0, 10]`.
116	fn set_calls(n: u32, ) -> Weight {
117		// Proof Size summary in bytes:
118		//  Measured:  `0`
119		//  Estimated: `0`
120		// Minimum execution time: 3_908_000 picoseconds.
121		Weight::from_parts(4_528_048, 0)
122			// Standard Error: 3_135
123			.saturating_add(Weight::from_parts(281_533, 0).saturating_mul(n.into()))
124			.saturating_add(T::DbWeight::get().writes(1_u64))
125	}
126	/// Storage: `Lottery::Lottery` (r:1 w:1)
127	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
128	/// Storage: `Lottery::LotteryIndex` (r:1 w:1)
129	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
130	/// Storage: `System::Account` (r:1 w:1)
131	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
132	fn start_lottery() -> Weight {
133		// Proof Size summary in bytes:
134		//  Measured:  `0`
135		//  Estimated: `3593`
136		// Minimum execution time: 23_155_000 picoseconds.
137		Weight::from_parts(23_832_000, 3593)
138			.saturating_add(T::DbWeight::get().reads(3_u64))
139			.saturating_add(T::DbWeight::get().writes(3_u64))
140	}
141	/// Storage: `Lottery::Lottery` (r:1 w:1)
142	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
143	fn stop_repeat() -> Weight {
144		// Proof Size summary in bytes:
145		//  Measured:  `94`
146		//  Estimated: `1514`
147		// Minimum execution time: 5_354_000 picoseconds.
148		Weight::from_parts(5_544_000, 1514)
149			.saturating_add(T::DbWeight::get().reads(1_u64))
150			.saturating_add(T::DbWeight::get().writes(1_u64))
151	}
152	/// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0)
153	/// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`)
154	/// Storage: `Lottery::Lottery` (r:1 w:1)
155	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
156	/// Storage: `System::Account` (r:2 w:2)
157	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
158	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
159	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
160	/// Storage: `Lottery::Tickets` (r:1 w:0)
161	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
162	fn on_initialize_end() -> Weight {
163		// Proof Size summary in bytes:
164		//  Measured:  `266`
165		//  Estimated: `6196`
166		// Minimum execution time: 57_804_000 picoseconds.
167		Weight::from_parts(58_907_000, 6196)
168			.saturating_add(T::DbWeight::get().reads(6_u64))
169			.saturating_add(T::DbWeight::get().writes(4_u64))
170	}
171	/// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0)
172	/// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`)
173	/// Storage: `Lottery::Lottery` (r:1 w:1)
174	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
175	/// Storage: `System::Account` (r:2 w:2)
176	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
177	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
178	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
179	/// Storage: `Lottery::Tickets` (r:1 w:0)
180	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
181	/// Storage: `Lottery::LotteryIndex` (r:1 w:1)
182	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
183	fn on_initialize_repeat() -> Weight {
184		// Proof Size summary in bytes:
185		//  Measured:  `266`
186		//  Estimated: `6196`
187		// Minimum execution time: 59_553_000 picoseconds.
188		Weight::from_parts(60_608_000, 6196)
189			.saturating_add(T::DbWeight::get().reads(7_u64))
190			.saturating_add(T::DbWeight::get().writes(5_u64))
191	}
192}
193
194// For backwards compatibility and tests.
195impl WeightInfo for () {
196	/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
197	/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
198	/// Storage: `TxPause::PausedCalls` (r:1 w:0)
199	/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
200	/// Storage: `Lottery::Lottery` (r:1 w:0)
201	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
202	/// Storage: `Lottery::CallIndices` (r:1 w:0)
203	/// Proof: `Lottery::CallIndices` (`max_values`: Some(1), `max_size`: Some(21), added: 516, mode: `MaxEncodedLen`)
204	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
205	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
206	/// Storage: `Lottery::Participants` (r:1 w:1)
207	/// Proof: `Lottery::Participants` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
208	/// Storage: `Lottery::LotteryIndex` (r:1 w:0)
209	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
210	/// Storage: `System::Account` (r:1 w:1)
211	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
212	/// Storage: `Lottery::Tickets` (r:0 w:1)
213	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
214	fn buy_ticket() -> Weight {
215		// Proof Size summary in bytes:
216		//  Measured:  `289`
217		//  Estimated: `3997`
218		// Minimum execution time: 57_591_000 picoseconds.
219		Weight::from_parts(59_527_000, 3997)
220			.saturating_add(RocksDbWeight::get().reads(8_u64))
221			.saturating_add(RocksDbWeight::get().writes(4_u64))
222	}
223	/// Storage: `Lottery::CallIndices` (r:0 w:1)
224	/// Proof: `Lottery::CallIndices` (`max_values`: Some(1), `max_size`: Some(21), added: 516, mode: `MaxEncodedLen`)
225	/// The range of component `n` is `[0, 10]`.
226	fn set_calls(n: u32, ) -> Weight {
227		// Proof Size summary in bytes:
228		//  Measured:  `0`
229		//  Estimated: `0`
230		// Minimum execution time: 3_908_000 picoseconds.
231		Weight::from_parts(4_528_048, 0)
232			// Standard Error: 3_135
233			.saturating_add(Weight::from_parts(281_533, 0).saturating_mul(n.into()))
234			.saturating_add(RocksDbWeight::get().writes(1_u64))
235	}
236	/// Storage: `Lottery::Lottery` (r:1 w:1)
237	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
238	/// Storage: `Lottery::LotteryIndex` (r:1 w:1)
239	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
240	/// Storage: `System::Account` (r:1 w:1)
241	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
242	fn start_lottery() -> Weight {
243		// Proof Size summary in bytes:
244		//  Measured:  `0`
245		//  Estimated: `3593`
246		// Minimum execution time: 23_155_000 picoseconds.
247		Weight::from_parts(23_832_000, 3593)
248			.saturating_add(RocksDbWeight::get().reads(3_u64))
249			.saturating_add(RocksDbWeight::get().writes(3_u64))
250	}
251	/// Storage: `Lottery::Lottery` (r:1 w:1)
252	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
253	fn stop_repeat() -> Weight {
254		// Proof Size summary in bytes:
255		//  Measured:  `94`
256		//  Estimated: `1514`
257		// Minimum execution time: 5_354_000 picoseconds.
258		Weight::from_parts(5_544_000, 1514)
259			.saturating_add(RocksDbWeight::get().reads(1_u64))
260			.saturating_add(RocksDbWeight::get().writes(1_u64))
261	}
262	/// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0)
263	/// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`)
264	/// Storage: `Lottery::Lottery` (r:1 w:1)
265	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
266	/// Storage: `System::Account` (r:2 w:2)
267	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
268	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
269	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
270	/// Storage: `Lottery::Tickets` (r:1 w:0)
271	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
272	fn on_initialize_end() -> Weight {
273		// Proof Size summary in bytes:
274		//  Measured:  `266`
275		//  Estimated: `6196`
276		// Minimum execution time: 57_804_000 picoseconds.
277		Weight::from_parts(58_907_000, 6196)
278			.saturating_add(RocksDbWeight::get().reads(6_u64))
279			.saturating_add(RocksDbWeight::get().writes(4_u64))
280	}
281	/// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0)
282	/// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`)
283	/// Storage: `Lottery::Lottery` (r:1 w:1)
284	/// Proof: `Lottery::Lottery` (`max_values`: Some(1), `max_size`: Some(29), added: 524, mode: `MaxEncodedLen`)
285	/// Storage: `System::Account` (r:2 w:2)
286	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
287	/// Storage: `Lottery::TicketsCount` (r:1 w:1)
288	/// Proof: `Lottery::TicketsCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
289	/// Storage: `Lottery::Tickets` (r:1 w:0)
290	/// Proof: `Lottery::Tickets` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
291	/// Storage: `Lottery::LotteryIndex` (r:1 w:1)
292	/// Proof: `Lottery::LotteryIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
293	fn on_initialize_repeat() -> Weight {
294		// Proof Size summary in bytes:
295		//  Measured:  `266`
296		//  Estimated: `6196`
297		// Minimum execution time: 59_553_000 picoseconds.
298		Weight::from_parts(60_608_000, 6196)
299			.saturating_add(RocksDbWeight::get().reads(7_u64))
300			.saturating_add(RocksDbWeight::get().writes(5_u64))
301	}
302}