common_runtime/weights/
pallet_proxy.rs1#![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
33pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_proxy::WeightInfo for SubstrateWeight<T> {
36 fn proxy(p: u32, ) -> Weight {
40 Weight::from_parts(16_865_154, 5201)
45 .saturating_add(Weight::from_parts(34_114, 0).saturating_mul(p.into()))
47 .saturating_add(T::DbWeight::get().reads(1_u64))
48 }
49 fn proxy_announced(a: u32, p: u32, ) -> Weight {
58 Weight::from_parts(40_194_312, 6193)
63 .saturating_add(Weight::from_parts(162_309, 0).saturating_mul(a.into()))
65 .saturating_add(Weight::from_parts(27_031, 0).saturating_mul(p.into()))
67 .saturating_add(T::DbWeight::get().reads(3_u64))
68 .saturating_add(T::DbWeight::get().writes(2_u64))
69 }
70 fn remove_announcement(a: u32, p: u32, ) -> Weight {
77 Weight::from_parts(28_842_812, 6193)
82 .saturating_add(Weight::from_parts(153_953, 0).saturating_mul(a.into()))
84 .saturating_add(Weight::from_parts(5_891, 0).saturating_mul(p.into()))
86 .saturating_add(T::DbWeight::get().reads(2_u64))
87 .saturating_add(T::DbWeight::get().writes(2_u64))
88 }
89 fn reject_announcement(a: u32, p: u32, ) -> Weight {
96 Weight::from_parts(28_836_759, 6193)
101 .saturating_add(Weight::from_parts(155_991, 0).saturating_mul(a.into()))
103 .saturating_add(Weight::from_parts(8_203, 0).saturating_mul(p.into()))
105 .saturating_add(T::DbWeight::get().reads(2_u64))
106 .saturating_add(T::DbWeight::get().writes(2_u64))
107 }
108 fn announce(a: u32, p: u32, ) -> Weight {
117 Weight::from_parts(36_334_018, 6193)
122 .saturating_add(Weight::from_parts(157_524, 0).saturating_mul(a.into()))
124 .saturating_add(Weight::from_parts(33_979, 0).saturating_mul(p.into()))
126 .saturating_add(T::DbWeight::get().reads(3_u64))
127 .saturating_add(T::DbWeight::get().writes(2_u64))
128 }
129 fn add_proxy(p: u32, ) -> Weight {
133 Weight::from_parts(26_978_804, 5201)
138 .saturating_add(Weight::from_parts(43_860, 0).saturating_mul(p.into()))
140 .saturating_add(T::DbWeight::get().reads(1_u64))
141 .saturating_add(T::DbWeight::get().writes(1_u64))
142 }
143 fn remove_proxy(p: u32, ) -> Weight {
147 Weight::from_parts(27_355_025, 5201)
152 .saturating_add(Weight::from_parts(38_568, 0).saturating_mul(p.into()))
154 .saturating_add(T::DbWeight::get().reads(1_u64))
155 .saturating_add(T::DbWeight::get().writes(1_u64))
156 }
157 fn remove_proxies(p: u32, ) -> Weight {
161 Weight::from_parts(24_831_692, 5201)
166 .saturating_add(Weight::from_parts(27_404, 0).saturating_mul(p.into()))
168 .saturating_add(T::DbWeight::get().reads(1_u64))
169 .saturating_add(T::DbWeight::get().writes(1_u64))
170 }
171 fn create_pure(p: u32, ) -> Weight {
175 Weight::from_parts(28_327_459, 5201)
180 .saturating_add(Weight::from_parts(17_353, 0).saturating_mul(p.into()))
182 .saturating_add(T::DbWeight::get().reads(1_u64))
183 .saturating_add(T::DbWeight::get().writes(1_u64))
184 }
185 fn kill_pure(p: u32, ) -> Weight {
189 Weight::from_parts(25_698_961, 5201)
194 .saturating_add(Weight::from_parts(27_626, 0).saturating_mul(p.into()))
196 .saturating_add(T::DbWeight::get().reads(1_u64))
197 .saturating_add(T::DbWeight::get().writes(1_u64))
198 }
199 fn poke_deposit() -> Weight {
206 Weight::from_parts(48_186_000, 6193)
211 .saturating_add(T::DbWeight::get().reads(3_u64))
212 .saturating_add(T::DbWeight::get().writes(3_u64))
213 }
214}
215
216
217#[cfg(test)]
218mod tests {
219 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
220 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
221 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
222
223 #[allow(dead_code)]
224 struct BlockWeights;
225 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
226 fn get() -> frame_system::limits::BlockWeights {
227 frame_system::limits::BlockWeights::builder()
228 .base_block(Weight::zero())
229 .for_class(DispatchClass::all(), |weights| {
230 weights.base_extrinsic = ExtrinsicBaseWeight::get();
231 })
232 .for_class(DispatchClass::non_mandatory(), |weights| {
233 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
234 })
235 .build_or_panic()
236 }
237 }
238
239 #[test]
240 fn test_proxy() {
241 assert!(
242 BlockWeights::get()
243 .per_class
244 .get(frame_support::dispatch::DispatchClass::Normal)
245 .max_extrinsic
246 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
247 .proof_size()
248 > 5201
249 );
250 }
251 #[test]
252 fn test_proxy_announced() {
253 assert!(
254 BlockWeights::get()
255 .per_class
256 .get(frame_support::dispatch::DispatchClass::Normal)
257 .max_extrinsic
258 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
259 .proof_size()
260 > 6193
261 );
262 }
263 #[test]
264 fn test_remove_announcement() {
265 assert!(
266 BlockWeights::get()
267 .per_class
268 .get(frame_support::dispatch::DispatchClass::Normal)
269 .max_extrinsic
270 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
271 .proof_size()
272 > 6193
273 );
274 }
275 #[test]
276 fn test_reject_announcement() {
277 assert!(
278 BlockWeights::get()
279 .per_class
280 .get(frame_support::dispatch::DispatchClass::Normal)
281 .max_extrinsic
282 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
283 .proof_size()
284 > 6193
285 );
286 }
287 #[test]
288 fn test_announce() {
289 assert!(
290 BlockWeights::get()
291 .per_class
292 .get(frame_support::dispatch::DispatchClass::Normal)
293 .max_extrinsic
294 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
295 .proof_size()
296 > 6193
297 );
298 }
299 #[test]
300 fn test_add_proxy() {
301 assert!(
302 BlockWeights::get()
303 .per_class
304 .get(frame_support::dispatch::DispatchClass::Normal)
305 .max_extrinsic
306 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
307 .proof_size()
308 > 5201
309 );
310 }
311 #[test]
312 fn test_remove_proxy() {
313 assert!(
314 BlockWeights::get()
315 .per_class
316 .get(frame_support::dispatch::DispatchClass::Normal)
317 .max_extrinsic
318 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
319 .proof_size()
320 > 5201
321 );
322 }
323 #[test]
324 fn test_remove_proxies() {
325 assert!(
326 BlockWeights::get()
327 .per_class
328 .get(frame_support::dispatch::DispatchClass::Normal)
329 .max_extrinsic
330 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
331 .proof_size()
332 > 5201
333 );
334 }
335 #[test]
336 fn test_create_pure() {
337 assert!(
338 BlockWeights::get()
339 .per_class
340 .get(frame_support::dispatch::DispatchClass::Normal)
341 .max_extrinsic
342 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
343 .proof_size()
344 > 5201
345 );
346 }
347 #[test]
348 fn test_kill_pure() {
349 assert!(
350 BlockWeights::get()
351 .per_class
352 .get(frame_support::dispatch::DispatchClass::Normal)
353 .max_extrinsic
354 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
355 .proof_size()
356 > 5201
357 );
358 }
359 #[test]
360 fn test_poke_deposit() {
361 assert!(
362 BlockWeights::get()
363 .per_class
364 .get(frame_support::dispatch::DispatchClass::Normal)
365 .max_extrinsic
366 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
367 .proof_size()
368 > 6193
369 );
370 }
371}