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(17_092_913, 5201)
45 .saturating_add(Weight::from_parts(37_418, 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(41_009_116, 6193)
63 .saturating_add(Weight::from_parts(181_575, 0).saturating_mul(a.into()))
65 .saturating_add(Weight::from_parts(36_817, 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(29_669_613, 6193)
82 .saturating_add(Weight::from_parts(167_195, 0).saturating_mul(a.into()))
84 .saturating_add(Weight::from_parts(5_301, 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(30_272_772, 6193)
101 .saturating_add(Weight::from_parts(162_701, 0).saturating_mul(a.into()))
103 .saturating_add(T::DbWeight::get().reads(2_u64))
104 .saturating_add(T::DbWeight::get().writes(2_u64))
105 }
106 fn announce(a: u32, p: u32, ) -> Weight {
115 Weight::from_parts(37_037_023, 6193)
120 .saturating_add(Weight::from_parts(164_634, 0).saturating_mul(a.into()))
122 .saturating_add(Weight::from_parts(36_479, 0).saturating_mul(p.into()))
124 .saturating_add(T::DbWeight::get().reads(3_u64))
125 .saturating_add(T::DbWeight::get().writes(2_u64))
126 }
127 fn add_proxy(p: u32, ) -> Weight {
131 Weight::from_parts(27_961_018, 5201)
136 .saturating_add(Weight::from_parts(48_600, 0).saturating_mul(p.into()))
138 .saturating_add(T::DbWeight::get().reads(1_u64))
139 .saturating_add(T::DbWeight::get().writes(1_u64))
140 }
141 fn remove_proxy(p: u32, ) -> Weight {
145 Weight::from_parts(28_104_292, 5201)
150 .saturating_add(Weight::from_parts(53_821, 0).saturating_mul(p.into()))
152 .saturating_add(T::DbWeight::get().reads(1_u64))
153 .saturating_add(T::DbWeight::get().writes(1_u64))
154 }
155 fn remove_proxies(p: u32, ) -> Weight {
159 Weight::from_parts(25_252_452, 5201)
164 .saturating_add(Weight::from_parts(32_669, 0).saturating_mul(p.into()))
166 .saturating_add(T::DbWeight::get().reads(1_u64))
167 .saturating_add(T::DbWeight::get().writes(1_u64))
168 }
169 fn create_pure(p: u32, ) -> Weight {
173 Weight::from_parts(29_317_835, 5201)
178 .saturating_add(Weight::from_parts(23_150, 0).saturating_mul(p.into()))
180 .saturating_add(T::DbWeight::get().reads(1_u64))
181 .saturating_add(T::DbWeight::get().writes(1_u64))
182 }
183 fn kill_pure(p: u32, ) -> Weight {
187 Weight::from_parts(28_490_074, 5201)
192 .saturating_add(Weight::from_parts(35_968, 0).saturating_mul(p.into()))
194 .saturating_add(T::DbWeight::get().reads(1_u64))
195 .saturating_add(T::DbWeight::get().writes(1_u64))
196 }
197 fn poke_deposit() -> Weight {
204 Weight::from_parts(49_216_000, 6193)
209 .saturating_add(T::DbWeight::get().reads(3_u64))
210 .saturating_add(T::DbWeight::get().writes(3_u64))
211 }
212}
213
214
215#[cfg(test)]
216mod tests {
217 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
218 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
219 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
220
221 #[allow(dead_code)]
222 struct BlockWeights;
223 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
224 fn get() -> frame_system::limits::BlockWeights {
225 frame_system::limits::BlockWeights::builder()
226 .base_block(Weight::zero())
227 .for_class(DispatchClass::all(), |weights| {
228 weights.base_extrinsic = ExtrinsicBaseWeight::get();
229 })
230 .for_class(DispatchClass::non_mandatory(), |weights| {
231 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
232 })
233 .build_or_panic()
234 }
235 }
236
237 #[test]
238 fn test_proxy() {
239 assert!(
240 BlockWeights::get()
241 .per_class
242 .get(frame_support::dispatch::DispatchClass::Normal)
243 .max_extrinsic
244 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
245 .proof_size()
246 > 5201
247 );
248 }
249 #[test]
250 fn test_proxy_announced() {
251 assert!(
252 BlockWeights::get()
253 .per_class
254 .get(frame_support::dispatch::DispatchClass::Normal)
255 .max_extrinsic
256 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
257 .proof_size()
258 > 6193
259 );
260 }
261 #[test]
262 fn test_remove_announcement() {
263 assert!(
264 BlockWeights::get()
265 .per_class
266 .get(frame_support::dispatch::DispatchClass::Normal)
267 .max_extrinsic
268 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
269 .proof_size()
270 > 6193
271 );
272 }
273 #[test]
274 fn test_reject_announcement() {
275 assert!(
276 BlockWeights::get()
277 .per_class
278 .get(frame_support::dispatch::DispatchClass::Normal)
279 .max_extrinsic
280 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
281 .proof_size()
282 > 6193
283 );
284 }
285 #[test]
286 fn test_announce() {
287 assert!(
288 BlockWeights::get()
289 .per_class
290 .get(frame_support::dispatch::DispatchClass::Normal)
291 .max_extrinsic
292 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
293 .proof_size()
294 > 6193
295 );
296 }
297 #[test]
298 fn test_add_proxy() {
299 assert!(
300 BlockWeights::get()
301 .per_class
302 .get(frame_support::dispatch::DispatchClass::Normal)
303 .max_extrinsic
304 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
305 .proof_size()
306 > 5201
307 );
308 }
309 #[test]
310 fn test_remove_proxy() {
311 assert!(
312 BlockWeights::get()
313 .per_class
314 .get(frame_support::dispatch::DispatchClass::Normal)
315 .max_extrinsic
316 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
317 .proof_size()
318 > 5201
319 );
320 }
321 #[test]
322 fn test_remove_proxies() {
323 assert!(
324 BlockWeights::get()
325 .per_class
326 .get(frame_support::dispatch::DispatchClass::Normal)
327 .max_extrinsic
328 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
329 .proof_size()
330 > 5201
331 );
332 }
333 #[test]
334 fn test_create_pure() {
335 assert!(
336 BlockWeights::get()
337 .per_class
338 .get(frame_support::dispatch::DispatchClass::Normal)
339 .max_extrinsic
340 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
341 .proof_size()
342 > 5201
343 );
344 }
345 #[test]
346 fn test_kill_pure() {
347 assert!(
348 BlockWeights::get()
349 .per_class
350 .get(frame_support::dispatch::DispatchClass::Normal)
351 .max_extrinsic
352 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
353 .proof_size()
354 > 5201
355 );
356 }
357 #[test]
358 fn test_poke_deposit() {
359 assert!(
360 BlockWeights::get()
361 .per_class
362 .get(frame_support::dispatch::DispatchClass::Normal)
363 .max_extrinsic
364 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
365 .proof_size()
366 > 6193
367 );
368 }
369}