common_runtime/weights/
pallet_multisig.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_multisig::WeightInfo for SubstrateWeight<T> {
36 fn as_multi_threshold_1(z: u32, ) -> Weight {
38 Weight::from_parts(23_260_054, 0)
43 .saturating_add(Weight::from_parts(1_936, 0).saturating_mul(z.into()))
45 }
46 fn as_multi_create(s: u32, z: u32, ) -> Weight {
51 Weight::from_parts(36_554_848, 7306)
56 .saturating_add(Weight::from_parts(140_707, 0).saturating_mul(s.into()))
58 .saturating_add(Weight::from_parts(2_006, 0).saturating_mul(z.into()))
60 .saturating_add(T::DbWeight::get().reads(1_u64))
61 .saturating_add(T::DbWeight::get().writes(1_u64))
62 }
63 fn as_multi_approve(s: u32, z: u32, ) -> Weight {
68 Weight::from_parts(21_517_028, 7306)
73 .saturating_add(Weight::from_parts(124_149, 0).saturating_mul(s.into()))
75 .saturating_add(Weight::from_parts(1_975, 0).saturating_mul(z.into()))
77 .saturating_add(T::DbWeight::get().reads(1_u64))
78 .saturating_add(T::DbWeight::get().writes(1_u64))
79 }
80 fn as_multi_complete(s: u32, z: u32, ) -> Weight {
87 Weight::from_parts(38_063_978, 7306)
92 .saturating_add(Weight::from_parts(190_461, 0).saturating_mul(s.into()))
94 .saturating_add(Weight::from_parts(2_045, 0).saturating_mul(z.into()))
96 .saturating_add(T::DbWeight::get().reads(2_u64))
97 .saturating_add(T::DbWeight::get().writes(2_u64))
98 }
99 fn approve_as_multi_create(s: u32, ) -> Weight {
103 Weight::from_parts(34_421_287, 7306)
108 .saturating_add(Weight::from_parts(143_799, 0).saturating_mul(s.into()))
110 .saturating_add(T::DbWeight::get().reads(1_u64))
111 .saturating_add(T::DbWeight::get().writes(1_u64))
112 }
113 fn approve_as_multi_approve(s: u32, ) -> Weight {
117 Weight::from_parts(19_800_499, 7306)
122 .saturating_add(Weight::from_parts(128_302, 0).saturating_mul(s.into()))
124 .saturating_add(T::DbWeight::get().reads(1_u64))
125 .saturating_add(T::DbWeight::get().writes(1_u64))
126 }
127 fn cancel_as_multi(s: u32, ) -> Weight {
131 Weight::from_parts(35_750_920, 7306)
136 .saturating_add(Weight::from_parts(137_335, 0).saturating_mul(s.into()))
138 .saturating_add(T::DbWeight::get().reads(1_u64))
139 .saturating_add(T::DbWeight::get().writes(1_u64))
140 }
141 fn poke_deposit(s: u32, ) -> Weight {
145 Weight::from_parts(33_879_744, 7306)
150 .saturating_add(Weight::from_parts(134_428, 0).saturating_mul(s.into()))
152 .saturating_add(T::DbWeight::get().reads(1_u64))
153 .saturating_add(T::DbWeight::get().writes(1_u64))
154 }
155}
156
157
158#[cfg(test)]
159mod tests {
160 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
161 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
162 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
163
164 #[allow(dead_code)]
165 struct BlockWeights;
166 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
167 fn get() -> frame_system::limits::BlockWeights {
168 frame_system::limits::BlockWeights::builder()
169 .base_block(Weight::zero())
170 .for_class(DispatchClass::all(), |weights| {
171 weights.base_extrinsic = ExtrinsicBaseWeight::get();
172 })
173 .for_class(DispatchClass::non_mandatory(), |weights| {
174 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
175 })
176 .build_or_panic()
177 }
178 }
179
180 #[test]
181 fn test_as_multi_create() {
182 assert!(
183 BlockWeights::get()
184 .per_class
185 .get(frame_support::dispatch::DispatchClass::Normal)
186 .max_extrinsic
187 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
188 .proof_size()
189 > 7306
190 );
191 }
192 #[test]
193 fn test_as_multi_approve() {
194 assert!(
195 BlockWeights::get()
196 .per_class
197 .get(frame_support::dispatch::DispatchClass::Normal)
198 .max_extrinsic
199 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
200 .proof_size()
201 > 7306
202 );
203 }
204 #[test]
205 fn test_as_multi_complete() {
206 assert!(
207 BlockWeights::get()
208 .per_class
209 .get(frame_support::dispatch::DispatchClass::Normal)
210 .max_extrinsic
211 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
212 .proof_size()
213 > 7306
214 );
215 }
216 #[test]
217 fn test_approve_as_multi_create() {
218 assert!(
219 BlockWeights::get()
220 .per_class
221 .get(frame_support::dispatch::DispatchClass::Normal)
222 .max_extrinsic
223 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
224 .proof_size()
225 > 7306
226 );
227 }
228 #[test]
229 fn test_approve_as_multi_approve() {
230 assert!(
231 BlockWeights::get()
232 .per_class
233 .get(frame_support::dispatch::DispatchClass::Normal)
234 .max_extrinsic
235 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
236 .proof_size()
237 > 7306
238 );
239 }
240 #[test]
241 fn test_cancel_as_multi() {
242 assert!(
243 BlockWeights::get()
244 .per_class
245 .get(frame_support::dispatch::DispatchClass::Normal)
246 .max_extrinsic
247 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
248 .proof_size()
249 > 7306
250 );
251 }
252 #[test]
253 fn test_poke_deposit() {
254 assert!(
255 BlockWeights::get()
256 .per_class
257 .get(frame_support::dispatch::DispatchClass::Normal)
258 .max_extrinsic
259 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
260 .proof_size()
261 > 7306
262 );
263 }
264}