common_runtime/weights/pallet_democracy.rs
1//! Autogenerated weights for pallet_democracy
2//!
3//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
4//! DATE: 2025-08-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5//! WORST CASE MAP SIZE: `1000000`
6//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
8
9// Executed Command:
10// ./scripts/../target/release/frequency
11// benchmark
12// pallet
13// --pallet=pallet_democracy
14// --extrinsic
15// *
16// --heap-pages=4096
17// --steps=50
18// --repeat=20
19// --output=./scripts/../runtime/common/src/weights
20// --template=./scripts/../.maintain/runtime-weight-template.hbs
21// --additional-trie-layers=3
22// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
23// --genesis-builder=runtime
24
25#![cfg_attr(rustfmt, rustfmt_skip)]
26#![allow(unused_parens)]
27#![allow(unused_imports)]
28#![allow(missing_docs)]
29
30use frame_support::{traits::Get, weights::Weight};
31use core::marker::PhantomData;
32
33/// Weights for `pallet_democracy` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_democracy::WeightInfo for SubstrateWeight<T> {
36 /// Storage: `Democracy::PublicPropCount` (r:1 w:1)
37 /// Proof: `Democracy::PublicPropCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
38 /// Storage: `Democracy::PublicProps` (r:1 w:1)
39 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
40 /// Storage: `Democracy::Blacklist` (r:1 w:0)
41 /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3238), added: 5713, mode: `MaxEncodedLen`)
42 /// Storage: `Democracy::DepositOf` (r:0 w:1)
43 /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`)
44 fn propose() -> Weight {
45 // Proof Size summary in bytes:
46 // Measured: `4768`
47 // Estimated: `18682`
48 // Minimum execution time: 48_243_000 picoseconds.
49 Weight::from_parts(49_642_000, 18682)
50 .saturating_add(T::DbWeight::get().reads(3_u64))
51 .saturating_add(T::DbWeight::get().writes(3_u64))
52 }
53 /// Storage: `Democracy::DepositOf` (r:1 w:1)
54 /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`)
55 fn second() -> Weight {
56 // Proof Size summary in bytes:
57 // Measured: `3523`
58 // Estimated: `7190`
59 // Minimum execution time: 42_680_000 picoseconds.
60 Weight::from_parts(43_871_000, 7190)
61 .saturating_add(T::DbWeight::get().reads(1_u64))
62 .saturating_add(T::DbWeight::get().writes(1_u64))
63 }
64 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
65 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
66 /// Storage: `Democracy::VotingOf` (r:1 w:1)
67 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
68 /// Storage: `Balances::Locks` (r:1 w:1)
69 /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
70 /// Storage: `Balances::Freezes` (r:1 w:0)
71 /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
72 fn vote_new() -> Weight {
73 // Proof Size summary in bytes:
74 // Measured: `3399`
75 // Estimated: `7755`
76 // Minimum execution time: 62_142_000 picoseconds.
77 Weight::from_parts(65_019_000, 7755)
78 .saturating_add(T::DbWeight::get().reads(4_u64))
79 .saturating_add(T::DbWeight::get().writes(3_u64))
80 }
81 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
82 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
83 /// Storage: `Democracy::VotingOf` (r:1 w:1)
84 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
85 /// Storage: `Balances::Locks` (r:1 w:1)
86 /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
87 /// Storage: `Balances::Freezes` (r:1 w:0)
88 /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
89 fn vote_existing() -> Weight {
90 // Proof Size summary in bytes:
91 // Measured: `3421`
92 // Estimated: `7755`
93 // Minimum execution time: 66_025_000 picoseconds.
94 Weight::from_parts(67_827_000, 7755)
95 .saturating_add(T::DbWeight::get().reads(4_u64))
96 .saturating_add(T::DbWeight::get().writes(3_u64))
97 }
98 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
99 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
100 /// Storage: `Democracy::Cancellations` (r:1 w:1)
101 /// Proof: `Democracy::Cancellations` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`)
102 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
103 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
104 fn emergency_cancel() -> Weight {
105 // Proof Size summary in bytes:
106 // Measured: `333`
107 // Estimated: `4161`
108 // Minimum execution time: 27_207_000 picoseconds.
109 Weight::from_parts(28_077_000, 4161)
110 .saturating_add(T::DbWeight::get().reads(3_u64))
111 .saturating_add(T::DbWeight::get().writes(3_u64))
112 }
113 /// Storage: `Democracy::PublicProps` (r:1 w:1)
114 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
115 /// Storage: `Democracy::DepositOf` (r:1 w:1)
116 /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`)
117 /// Storage: `System::Account` (r:1 w:1)
118 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
119 /// Storage: `Democracy::MetadataOf` (r:3 w:1)
120 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
121 /// Storage: `Democracy::NextExternal` (r:1 w:1)
122 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
123 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
124 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
125 /// Storage: `Democracy::Blacklist` (r:0 w:1)
126 /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3238), added: 5713, mode: `MaxEncodedLen`)
127 fn blacklist() -> Weight {
128 // Proof Size summary in bytes:
129 // Measured: `5877`
130 // Estimated: `18682`
131 // Minimum execution time: 102_543_000 picoseconds.
132 Weight::from_parts(104_285_000, 18682)
133 .saturating_add(T::DbWeight::get().reads(8_u64))
134 .saturating_add(T::DbWeight::get().writes(7_u64))
135 }
136 /// Storage: `Democracy::NextExternal` (r:1 w:1)
137 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
138 /// Storage: `Democracy::Blacklist` (r:1 w:0)
139 /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3238), added: 5713, mode: `MaxEncodedLen`)
140 fn external_propose() -> Weight {
141 // Proof Size summary in bytes:
142 // Measured: `3383`
143 // Estimated: `7198`
144 // Minimum execution time: 15_425_000 picoseconds.
145 Weight::from_parts(15_971_000, 7198)
146 .saturating_add(T::DbWeight::get().reads(2_u64))
147 .saturating_add(T::DbWeight::get().writes(1_u64))
148 }
149 /// Storage: `Democracy::NextExternal` (r:0 w:1)
150 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
151 fn external_propose_majority() -> Weight {
152 // Proof Size summary in bytes:
153 // Measured: `0`
154 // Estimated: `0`
155 // Minimum execution time: 2_897_000 picoseconds.
156 Weight::from_parts(3_120_000, 0)
157 .saturating_add(T::DbWeight::get().writes(1_u64))
158 }
159 /// Storage: `Democracy::NextExternal` (r:0 w:1)
160 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
161 fn external_propose_default() -> Weight {
162 // Proof Size summary in bytes:
163 // Measured: `0`
164 // Estimated: `0`
165 // Minimum execution time: 2_955_000 picoseconds.
166 Weight::from_parts(3_064_000, 0)
167 .saturating_add(T::DbWeight::get().writes(1_u64))
168 }
169 /// Storage: `Democracy::NextExternal` (r:1 w:1)
170 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
171 /// Storage: `Democracy::ReferendumCount` (r:1 w:1)
172 /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
173 /// Storage: `Democracy::MetadataOf` (r:1 w:2)
174 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
175 /// Storage: `Democracy::ReferendumInfoOf` (r:0 w:1)
176 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
177 fn fast_track() -> Weight {
178 // Proof Size summary in bytes:
179 // Measured: `253`
180 // Estimated: `4013`
181 // Minimum execution time: 26_314_000 picoseconds.
182 Weight::from_parts(27_362_000, 4013)
183 .saturating_add(T::DbWeight::get().reads(3_u64))
184 .saturating_add(T::DbWeight::get().writes(5_u64))
185 }
186 /// Storage: `Democracy::NextExternal` (r:1 w:1)
187 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
188 /// Storage: `Democracy::Blacklist` (r:1 w:1)
189 /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3238), added: 5713, mode: `MaxEncodedLen`)
190 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
191 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
192 fn veto_external() -> Weight {
193 // Proof Size summary in bytes:
194 // Measured: `3486`
195 // Estimated: `7198`
196 // Minimum execution time: 30_085_000 picoseconds.
197 Weight::from_parts(31_198_000, 7198)
198 .saturating_add(T::DbWeight::get().reads(3_u64))
199 .saturating_add(T::DbWeight::get().writes(3_u64))
200 }
201 /// Storage: `Democracy::PublicProps` (r:1 w:1)
202 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
203 /// Storage: `Democracy::DepositOf` (r:1 w:1)
204 /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`)
205 /// Storage: `System::Account` (r:1 w:1)
206 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
207 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
208 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
209 fn cancel_proposal() -> Weight {
210 // Proof Size summary in bytes:
211 // Measured: `5788`
212 // Estimated: `18682`
213 // Minimum execution time: 80_376_000 picoseconds.
214 Weight::from_parts(82_053_000, 18682)
215 .saturating_add(T::DbWeight::get().reads(4_u64))
216 .saturating_add(T::DbWeight::get().writes(4_u64))
217 }
218 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
219 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
220 /// Storage: `Democracy::ReferendumInfoOf` (r:0 w:1)
221 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
222 fn cancel_referendum() -> Weight {
223 // Proof Size summary in bytes:
224 // Measured: `238`
225 // Estimated: `4013`
226 // Minimum execution time: 19_502_000 picoseconds.
227 Weight::from_parts(19_942_000, 4013)
228 .saturating_add(T::DbWeight::get().reads(1_u64))
229 .saturating_add(T::DbWeight::get().writes(2_u64))
230 }
231 /// Storage: `Democracy::LowestUnbaked` (r:1 w:1)
232 /// Proof: `Democracy::LowestUnbaked` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
233 /// Storage: `Democracy::ReferendumCount` (r:1 w:0)
234 /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
235 /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:0)
236 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
237 /// The range of component `r` is `[0, 99]`.
238 fn on_initialize_base(r: u32, ) -> Weight {
239 // Proof Size summary in bytes:
240 // Measured: `211 + r * (86 ±0)`
241 // Estimated: `1984 + r * (2676 ±0)`
242 // Minimum execution time: 6_511_000 picoseconds.
243 Weight::from_parts(5_396_290, 1984)
244 // Standard Error: 10_538
245 .saturating_add(Weight::from_parts(3_812_223, 0).saturating_mul(r.into()))
246 .saturating_add(T::DbWeight::get().reads(2_u64))
247 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
248 .saturating_add(T::DbWeight::get().writes(1_u64))
249 .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
250 }
251 /// Storage: `Democracy::LowestUnbaked` (r:1 w:1)
252 /// Proof: `Democracy::LowestUnbaked` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
253 /// Storage: `Democracy::ReferendumCount` (r:1 w:0)
254 /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
255 /// Storage: `Democracy::LastTabledWasExternal` (r:1 w:0)
256 /// Proof: `Democracy::LastTabledWasExternal` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
257 /// Storage: `Democracy::NextExternal` (r:1 w:0)
258 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
259 /// Storage: `Democracy::PublicProps` (r:1 w:0)
260 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
261 /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:0)
262 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
263 /// The range of component `r` is `[0, 99]`.
264 fn on_initialize_base_with_launch_period(r: u32, ) -> Weight {
265 // Proof Size summary in bytes:
266 // Measured: `211 + r * (86 ±0)`
267 // Estimated: `18682 + r * (2676 ±0)`
268 // Minimum execution time: 9_435_000 picoseconds.
269 Weight::from_parts(8_590_431, 18682)
270 // Standard Error: 11_938
271 .saturating_add(Weight::from_parts(3_835_085, 0).saturating_mul(r.into()))
272 .saturating_add(T::DbWeight::get().reads(5_u64))
273 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
274 .saturating_add(T::DbWeight::get().writes(1_u64))
275 .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
276 }
277 /// Storage: `Democracy::VotingOf` (r:3 w:3)
278 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
279 /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:99)
280 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
281 /// Storage: `Balances::Locks` (r:1 w:1)
282 /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
283 /// Storage: `Balances::Freezes` (r:1 w:0)
284 /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
285 /// The range of component `r` is `[0, 99]`.
286 fn delegate(r: u32, ) -> Weight {
287 // Proof Size summary in bytes:
288 // Measured: `763 + r * (108 ±0)`
289 // Estimated: `20295 + r * (2676 ±0)`
290 // Minimum execution time: 44_757_000 picoseconds.
291 Weight::from_parts(46_882_081, 20295)
292 // Standard Error: 11_848
293 .saturating_add(Weight::from_parts(4_855_694, 0).saturating_mul(r.into()))
294 .saturating_add(T::DbWeight::get().reads(5_u64))
295 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
296 .saturating_add(T::DbWeight::get().writes(4_u64))
297 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
298 .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
299 }
300 /// Storage: `Democracy::VotingOf` (r:2 w:2)
301 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
302 /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:99)
303 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
304 /// The range of component `r` is `[0, 99]`.
305 fn undelegate(r: u32, ) -> Weight {
306 // Proof Size summary in bytes:
307 // Measured: `460 + r * (108 ±0)`
308 // Estimated: `14025 + r * (2676 ±0)`
309 // Minimum execution time: 22_329_000 picoseconds.
310 Weight::from_parts(19_882_557, 14025)
311 // Standard Error: 10_791
312 .saturating_add(Weight::from_parts(4_757_318, 0).saturating_mul(r.into()))
313 .saturating_add(T::DbWeight::get().reads(2_u64))
314 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
315 .saturating_add(T::DbWeight::get().writes(2_u64))
316 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
317 .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
318 }
319 /// Storage: `Democracy::PublicProps` (r:0 w:1)
320 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
321 fn clear_public_proposals() -> Weight {
322 // Proof Size summary in bytes:
323 // Measured: `0`
324 // Estimated: `0`
325 // Minimum execution time: 2_725_000 picoseconds.
326 Weight::from_parts(2_862_000, 0)
327 .saturating_add(T::DbWeight::get().writes(1_u64))
328 }
329 /// Storage: `Democracy::VotingOf` (r:1 w:1)
330 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
331 /// Storage: `Balances::Locks` (r:1 w:1)
332 /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
333 /// Storage: `Balances::Freezes` (r:1 w:0)
334 /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
335 /// Storage: `System::Account` (r:1 w:1)
336 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
337 /// The range of component `r` is `[0, 99]`.
338 fn unlock_remove(r: u32, ) -> Weight {
339 // Proof Size summary in bytes:
340 // Measured: `492`
341 // Estimated: `7755`
342 // Minimum execution time: 26_492_000 picoseconds.
343 Weight::from_parts(38_261_481, 7755)
344 // Standard Error: 2_735
345 .saturating_add(Weight::from_parts(123_960, 0).saturating_mul(r.into()))
346 .saturating_add(T::DbWeight::get().reads(4_u64))
347 .saturating_add(T::DbWeight::get().writes(3_u64))
348 }
349 /// Storage: `Democracy::VotingOf` (r:1 w:1)
350 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
351 /// Storage: `Balances::Locks` (r:1 w:1)
352 /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
353 /// Storage: `Balances::Freezes` (r:1 w:0)
354 /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
355 /// Storage: `System::Account` (r:1 w:1)
356 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
357 /// The range of component `r` is `[0, 99]`.
358 fn unlock_set(r: u32, ) -> Weight {
359 // Proof Size summary in bytes:
360 // Measured: `493 + r * (22 ±0)`
361 // Estimated: `7755`
362 // Minimum execution time: 36_198_000 picoseconds.
363 Weight::from_parts(39_996_124, 7755)
364 // Standard Error: 1_875
365 .saturating_add(Weight::from_parts(134_697, 0).saturating_mul(r.into()))
366 .saturating_add(T::DbWeight::get().reads(4_u64))
367 .saturating_add(T::DbWeight::get().writes(3_u64))
368 }
369 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
370 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
371 /// Storage: `Democracy::VotingOf` (r:1 w:1)
372 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
373 /// The range of component `r` is `[1, 100]`.
374 fn remove_vote(r: u32, ) -> Weight {
375 // Proof Size summary in bytes:
376 // Measured: `695 + r * (26 ±0)`
377 // Estimated: `7755`
378 // Minimum execution time: 19_240_000 picoseconds.
379 Weight::from_parts(23_134_324, 7755)
380 // Standard Error: 1_595
381 .saturating_add(Weight::from_parts(142_939, 0).saturating_mul(r.into()))
382 .saturating_add(T::DbWeight::get().reads(2_u64))
383 .saturating_add(T::DbWeight::get().writes(2_u64))
384 }
385 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1)
386 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
387 /// Storage: `Democracy::VotingOf` (r:1 w:1)
388 /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3795), added: 6270, mode: `MaxEncodedLen`)
389 /// The range of component `r` is `[1, 100]`.
390 fn remove_other_vote(r: u32, ) -> Weight {
391 // Proof Size summary in bytes:
392 // Measured: `695 + r * (26 ±0)`
393 // Estimated: `7755`
394 // Minimum execution time: 18_946_000 picoseconds.
395 Weight::from_parts(23_173_762, 7755)
396 // Standard Error: 1_823
397 .saturating_add(Weight::from_parts(145_845, 0).saturating_mul(r.into()))
398 .saturating_add(T::DbWeight::get().reads(2_u64))
399 .saturating_add(T::DbWeight::get().writes(2_u64))
400 }
401 /// Storage: `Democracy::NextExternal` (r:1 w:0)
402 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
403 /// Storage: `Preimage::StatusFor` (r:1 w:0)
404 /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
405 /// Storage: `Preimage::RequestStatusFor` (r:1 w:0)
406 /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
407 /// Storage: `Democracy::MetadataOf` (r:0 w:1)
408 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
409 fn set_external_metadata() -> Weight {
410 // Proof Size summary in bytes:
411 // Measured: `285`
412 // Estimated: `4051`
413 // Minimum execution time: 21_050_000 picoseconds.
414 Weight::from_parts(21_531_000, 4051)
415 .saturating_add(T::DbWeight::get().reads(3_u64))
416 .saturating_add(T::DbWeight::get().writes(1_u64))
417 }
418 /// Storage: `Democracy::NextExternal` (r:1 w:0)
419 /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`)
420 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
421 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
422 fn clear_external_metadata() -> Weight {
423 // Proof Size summary in bytes:
424 // Measured: `253`
425 // Estimated: `4013`
426 // Minimum execution time: 18_106_000 picoseconds.
427 Weight::from_parts(18_489_000, 4013)
428 .saturating_add(T::DbWeight::get().reads(2_u64))
429 .saturating_add(T::DbWeight::get().writes(1_u64))
430 }
431 /// Storage: `Democracy::PublicProps` (r:1 w:0)
432 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
433 /// Storage: `Preimage::StatusFor` (r:1 w:0)
434 /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
435 /// Storage: `Preimage::RequestStatusFor` (r:1 w:0)
436 /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
437 /// Storage: `Democracy::MetadataOf` (r:0 w:1)
438 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
439 fn set_proposal_metadata() -> Weight {
440 // Proof Size summary in bytes:
441 // Measured: `4817`
442 // Estimated: `18682`
443 // Minimum execution time: 49_843_000 picoseconds.
444 Weight::from_parts(50_706_000, 18682)
445 .saturating_add(T::DbWeight::get().reads(3_u64))
446 .saturating_add(T::DbWeight::get().writes(1_u64))
447 }
448 /// Storage: `Democracy::PublicProps` (r:1 w:0)
449 /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`)
450 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
451 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
452 fn clear_proposal_metadata() -> Weight {
453 // Proof Size summary in bytes:
454 // Measured: `4789`
455 // Estimated: `18682`
456 // Minimum execution time: 44_640_000 picoseconds.
457 Weight::from_parts(45_788_000, 18682)
458 .saturating_add(T::DbWeight::get().reads(2_u64))
459 .saturating_add(T::DbWeight::get().writes(1_u64))
460 }
461 /// Storage: `Preimage::StatusFor` (r:1 w:0)
462 /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
463 /// Storage: `Preimage::RequestStatusFor` (r:1 w:0)
464 /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
465 /// Storage: `Democracy::MetadataOf` (r:0 w:1)
466 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
467 fn set_referendum_metadata() -> Weight {
468 // Proof Size summary in bytes:
469 // Measured: `106`
470 // Estimated: `4051`
471 // Minimum execution time: 14_365_000 picoseconds.
472 Weight::from_parts(14_937_000, 4051)
473 .saturating_add(T::DbWeight::get().reads(2_u64))
474 .saturating_add(T::DbWeight::get().writes(1_u64))
475 }
476 /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:0)
477 /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(201), added: 2676, mode: `MaxEncodedLen`)
478 /// Storage: `Democracy::MetadataOf` (r:1 w:1)
479 /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
480 fn clear_referendum_metadata() -> Weight {
481 // Proof Size summary in bytes:
482 // Measured: `269`
483 // Estimated: `4161`
484 // Minimum execution time: 20_569_000 picoseconds.
485 Weight::from_parts(21_459_000, 4161)
486 .saturating_add(T::DbWeight::get().reads(2_u64))
487 .saturating_add(T::DbWeight::get().writes(1_u64))
488 }
489}
490
491
492#[cfg(test)]
493mod tests {
494 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
495 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
496 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
497
498 #[allow(dead_code)]
499 struct BlockWeights;
500 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
501 fn get() -> frame_system::limits::BlockWeights {
502 frame_system::limits::BlockWeights::builder()
503 .base_block(Weight::zero())
504 .for_class(DispatchClass::all(), |weights| {
505 weights.base_extrinsic = ExtrinsicBaseWeight::get();
506 })
507 .for_class(DispatchClass::non_mandatory(), |weights| {
508 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
509 })
510 .build_or_panic()
511 }
512 }
513
514 #[test]
515 fn test_propose() {
516 assert!(
517 BlockWeights::get()
518 .per_class
519 .get(frame_support::dispatch::DispatchClass::Normal)
520 .max_extrinsic
521 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
522 .proof_size()
523 > 18682
524 );
525 }
526 #[test]
527 fn test_second() {
528 assert!(
529 BlockWeights::get()
530 .per_class
531 .get(frame_support::dispatch::DispatchClass::Normal)
532 .max_extrinsic
533 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
534 .proof_size()
535 > 7190
536 );
537 }
538 #[test]
539 fn test_vote_new() {
540 assert!(
541 BlockWeights::get()
542 .per_class
543 .get(frame_support::dispatch::DispatchClass::Normal)
544 .max_extrinsic
545 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
546 .proof_size()
547 > 7755
548 );
549 }
550 #[test]
551 fn test_vote_existing() {
552 assert!(
553 BlockWeights::get()
554 .per_class
555 .get(frame_support::dispatch::DispatchClass::Normal)
556 .max_extrinsic
557 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
558 .proof_size()
559 > 7755
560 );
561 }
562 #[test]
563 fn test_emergency_cancel() {
564 assert!(
565 BlockWeights::get()
566 .per_class
567 .get(frame_support::dispatch::DispatchClass::Normal)
568 .max_extrinsic
569 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
570 .proof_size()
571 > 4161
572 );
573 }
574 #[test]
575 fn test_blacklist() {
576 assert!(
577 BlockWeights::get()
578 .per_class
579 .get(frame_support::dispatch::DispatchClass::Normal)
580 .max_extrinsic
581 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
582 .proof_size()
583 > 18682
584 );
585 }
586 #[test]
587 fn test_external_propose() {
588 assert!(
589 BlockWeights::get()
590 .per_class
591 .get(frame_support::dispatch::DispatchClass::Normal)
592 .max_extrinsic
593 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
594 .proof_size()
595 > 7198
596 );
597 }
598 #[test]
599 fn test_fast_track() {
600 assert!(
601 BlockWeights::get()
602 .per_class
603 .get(frame_support::dispatch::DispatchClass::Normal)
604 .max_extrinsic
605 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
606 .proof_size()
607 > 4013
608 );
609 }
610 #[test]
611 fn test_veto_external() {
612 assert!(
613 BlockWeights::get()
614 .per_class
615 .get(frame_support::dispatch::DispatchClass::Normal)
616 .max_extrinsic
617 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
618 .proof_size()
619 > 7198
620 );
621 }
622 #[test]
623 fn test_cancel_proposal() {
624 assert!(
625 BlockWeights::get()
626 .per_class
627 .get(frame_support::dispatch::DispatchClass::Normal)
628 .max_extrinsic
629 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
630 .proof_size()
631 > 18682
632 );
633 }
634 #[test]
635 fn test_cancel_referendum() {
636 assert!(
637 BlockWeights::get()
638 .per_class
639 .get(frame_support::dispatch::DispatchClass::Normal)
640 .max_extrinsic
641 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
642 .proof_size()
643 > 4013
644 );
645 }
646 #[test]
647 fn test_on_initialize_base() {
648 assert!(
649 BlockWeights::get()
650 .per_class
651 .get(frame_support::dispatch::DispatchClass::Normal)
652 .max_extrinsic
653 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
654 .proof_size()
655 > 1984
656 );
657 }
658 #[test]
659 fn test_on_initialize_base_with_launch_period() {
660 assert!(
661 BlockWeights::get()
662 .per_class
663 .get(frame_support::dispatch::DispatchClass::Normal)
664 .max_extrinsic
665 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
666 .proof_size()
667 > 18682
668 );
669 }
670 #[test]
671 fn test_delegate() {
672 assert!(
673 BlockWeights::get()
674 .per_class
675 .get(frame_support::dispatch::DispatchClass::Normal)
676 .max_extrinsic
677 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
678 .proof_size()
679 > 20295
680 );
681 }
682 #[test]
683 fn test_undelegate() {
684 assert!(
685 BlockWeights::get()
686 .per_class
687 .get(frame_support::dispatch::DispatchClass::Normal)
688 .max_extrinsic
689 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
690 .proof_size()
691 > 14025
692 );
693 }
694 #[test]
695 fn test_unlock_remove() {
696 assert!(
697 BlockWeights::get()
698 .per_class
699 .get(frame_support::dispatch::DispatchClass::Normal)
700 .max_extrinsic
701 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
702 .proof_size()
703 > 7755
704 );
705 }
706 #[test]
707 fn test_unlock_set() {
708 assert!(
709 BlockWeights::get()
710 .per_class
711 .get(frame_support::dispatch::DispatchClass::Normal)
712 .max_extrinsic
713 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
714 .proof_size()
715 > 7755
716 );
717 }
718 #[test]
719 fn test_remove_vote() {
720 assert!(
721 BlockWeights::get()
722 .per_class
723 .get(frame_support::dispatch::DispatchClass::Normal)
724 .max_extrinsic
725 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
726 .proof_size()
727 > 7755
728 );
729 }
730 #[test]
731 fn test_remove_other_vote() {
732 assert!(
733 BlockWeights::get()
734 .per_class
735 .get(frame_support::dispatch::DispatchClass::Normal)
736 .max_extrinsic
737 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
738 .proof_size()
739 > 7755
740 );
741 }
742 #[test]
743 fn test_set_external_metadata() {
744 assert!(
745 BlockWeights::get()
746 .per_class
747 .get(frame_support::dispatch::DispatchClass::Normal)
748 .max_extrinsic
749 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
750 .proof_size()
751 > 4051
752 );
753 }
754 #[test]
755 fn test_clear_external_metadata() {
756 assert!(
757 BlockWeights::get()
758 .per_class
759 .get(frame_support::dispatch::DispatchClass::Normal)
760 .max_extrinsic
761 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
762 .proof_size()
763 > 4013
764 );
765 }
766 #[test]
767 fn test_set_proposal_metadata() {
768 assert!(
769 BlockWeights::get()
770 .per_class
771 .get(frame_support::dispatch::DispatchClass::Normal)
772 .max_extrinsic
773 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
774 .proof_size()
775 > 18682
776 );
777 }
778 #[test]
779 fn test_clear_proposal_metadata() {
780 assert!(
781 BlockWeights::get()
782 .per_class
783 .get(frame_support::dispatch::DispatchClass::Normal)
784 .max_extrinsic
785 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
786 .proof_size()
787 > 18682
788 );
789 }
790 #[test]
791 fn test_set_referendum_metadata() {
792 assert!(
793 BlockWeights::get()
794 .per_class
795 .get(frame_support::dispatch::DispatchClass::Normal)
796 .max_extrinsic
797 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
798 .proof_size()
799 > 4051
800 );
801 }
802 #[test]
803 fn test_clear_referendum_metadata() {
804 assert!(
805 BlockWeights::get()
806 .per_class
807 .get(frame_support::dispatch::DispatchClass::Normal)
808 .max_extrinsic
809 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
810 .proof_size()
811 > 4161
812 );
813 }
814}