common_runtime/weights/pallet_assets.rs
1//! Autogenerated weights for pallet_assets
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_assets
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_assets` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_assets::WeightInfo for SubstrateWeight<T> {
36 fn create() -> Weight {
37 // Proof Size summary in bytes:
38 // Measured: `0`
39 // Estimated: `0`
40 // Minimum execution time: 0_000 picoseconds.
41 Weight::from_parts(0, 0)
42 }
43 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
44 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
45 /// Storage: `ForeignAssets::NextAssetId` (r:1 w:0)
46 /// Proof: `ForeignAssets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(602), added: 1097, mode: `MaxEncodedLen`)
47 fn force_create() -> Weight {
48 // Proof Size summary in bytes:
49 // Measured: `4`
50 // Estimated: `4768`
51 // Minimum execution time: 11_756_000 picoseconds.
52 Weight::from_parts(12_285_000, 4768)
53 .saturating_add(T::DbWeight::get().reads(2_u64))
54 .saturating_add(T::DbWeight::get().writes(1_u64))
55 }
56 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
57 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
58 fn start_destroy() -> Weight {
59 // Proof Size summary in bytes:
60 // Measured: `276`
61 // Estimated: `4768`
62 // Minimum execution time: 14_256_000 picoseconds.
63 Weight::from_parts(15_115_000, 4768)
64 .saturating_add(T::DbWeight::get().reads(1_u64))
65 .saturating_add(T::DbWeight::get().writes(1_u64))
66 }
67 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
68 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
69 /// Storage: `ForeignAssets::Account` (r:1001 w:1000)
70 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
71 /// Storage: `System::Account` (r:1000 w:1000)
72 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
73 /// The range of component `c` is `[0, 1000]`.
74 fn destroy_accounts(c: u32, ) -> Weight {
75 // Proof Size summary in bytes:
76 // Measured: `116 + c * (208 ±0)`
77 // Estimated: `4768 + c * (3207 ±0)`
78 // Minimum execution time: 16_467_000 picoseconds.
79 Weight::from_parts(16_760_000, 4768)
80 // Standard Error: 17_269
81 .saturating_add(Weight::from_parts(14_798_299, 0).saturating_mul(c.into()))
82 .saturating_add(T::DbWeight::get().reads(2_u64))
83 .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into())))
84 .saturating_add(T::DbWeight::get().writes(1_u64))
85 .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into())))
86 .saturating_add(Weight::from_parts(0, 3207).saturating_mul(c.into()))
87 }
88 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
89 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
90 /// Storage: `ForeignAssets::Approvals` (r:1001 w:1000)
91 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
92 /// The range of component `a` is `[0, 1000]`.
93 fn destroy_approvals(a: u32, ) -> Weight {
94 // Proof Size summary in bytes:
95 // Measured: `413 + a * (86 ±0)`
96 // Estimated: `4768 + a * (3221 ±0)`
97 // Minimum execution time: 19_347_000 picoseconds.
98 Weight::from_parts(19_791_000, 4768)
99 // Standard Error: 5_571
100 .saturating_add(Weight::from_parts(5_730_584, 0).saturating_mul(a.into()))
101 .saturating_add(T::DbWeight::get().reads(2_u64))
102 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into())))
103 .saturating_add(T::DbWeight::get().writes(1_u64))
104 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into())))
105 .saturating_add(Weight::from_parts(0, 3221).saturating_mul(a.into()))
106 }
107 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
108 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
109 /// Storage: `ForeignAssets::Metadata` (r:1 w:0)
110 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
111 fn finish_destroy() -> Weight {
112 // Proof Size summary in bytes:
113 // Measured: `242`
114 // Estimated: `4768`
115 // Minimum execution time: 13_532_000 picoseconds.
116 Weight::from_parts(14_089_000, 4768)
117 .saturating_add(T::DbWeight::get().reads(2_u64))
118 .saturating_add(T::DbWeight::get().writes(1_u64))
119 }
120 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
121 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
122 /// Storage: `ForeignAssets::Account` (r:1 w:1)
123 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
124 fn mint() -> Weight {
125 // Proof Size summary in bytes:
126 // Measured: `242`
127 // Estimated: `4768`
128 // Minimum execution time: 24_371_000 picoseconds.
129 Weight::from_parts(25_285_000, 4768)
130 .saturating_add(T::DbWeight::get().reads(2_u64))
131 .saturating_add(T::DbWeight::get().writes(2_u64))
132 }
133 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
134 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
135 /// Storage: `ForeignAssets::Account` (r:1 w:1)
136 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
137 fn burn() -> Weight {
138 // Proof Size summary in bytes:
139 // Measured: `350`
140 // Estimated: `4768`
141 // Minimum execution time: 34_964_000 picoseconds.
142 Weight::from_parts(35_991_000, 4768)
143 .saturating_add(T::DbWeight::get().reads(2_u64))
144 .saturating_add(T::DbWeight::get().writes(2_u64))
145 }
146 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
147 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
148 /// Storage: `ForeignAssets::Account` (r:2 w:2)
149 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
150 /// Storage: `System::Account` (r:1 w:1)
151 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
152 fn transfer() -> Weight {
153 // Proof Size summary in bytes:
154 // Measured: `389`
155 // Estimated: `7899`
156 // Minimum execution time: 48_302_000 picoseconds.
157 Weight::from_parts(49_284_000, 7899)
158 .saturating_add(T::DbWeight::get().reads(4_u64))
159 .saturating_add(T::DbWeight::get().writes(4_u64))
160 }
161 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
162 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
163 /// Storage: `ForeignAssets::Account` (r:2 w:2)
164 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
165 /// Storage: `System::Account` (r:1 w:1)
166 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
167 fn transfer_keep_alive() -> Weight {
168 // Proof Size summary in bytes:
169 // Measured: `389`
170 // Estimated: `7899`
171 // Minimum execution time: 43_232_000 picoseconds.
172 Weight::from_parts(44_742_000, 7899)
173 .saturating_add(T::DbWeight::get().reads(4_u64))
174 .saturating_add(T::DbWeight::get().writes(4_u64))
175 }
176 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
177 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
178 /// Storage: `ForeignAssets::Account` (r:2 w:2)
179 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
180 /// Storage: `System::Account` (r:1 w:1)
181 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
182 fn force_transfer() -> Weight {
183 // Proof Size summary in bytes:
184 // Measured: `389`
185 // Estimated: `7899`
186 // Minimum execution time: 48_059_000 picoseconds.
187 Weight::from_parts(50_319_000, 7899)
188 .saturating_add(T::DbWeight::get().reads(4_u64))
189 .saturating_add(T::DbWeight::get().writes(4_u64))
190 }
191 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
192 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
193 /// Storage: `ForeignAssets::Account` (r:1 w:1)
194 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
195 fn freeze() -> Weight {
196 // Proof Size summary in bytes:
197 // Measured: `350`
198 // Estimated: `4768`
199 // Minimum execution time: 18_930_000 picoseconds.
200 Weight::from_parts(19_728_000, 4768)
201 .saturating_add(T::DbWeight::get().reads(2_u64))
202 .saturating_add(T::DbWeight::get().writes(1_u64))
203 }
204 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
205 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
206 /// Storage: `ForeignAssets::Account` (r:1 w:1)
207 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
208 fn thaw() -> Weight {
209 // Proof Size summary in bytes:
210 // Measured: `350`
211 // Estimated: `4768`
212 // Minimum execution time: 18_909_000 picoseconds.
213 Weight::from_parts(19_513_000, 4768)
214 .saturating_add(T::DbWeight::get().reads(2_u64))
215 .saturating_add(T::DbWeight::get().writes(1_u64))
216 }
217 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
218 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
219 fn freeze_asset() -> Weight {
220 // Proof Size summary in bytes:
221 // Measured: `276`
222 // Estimated: `4768`
223 // Minimum execution time: 14_456_000 picoseconds.
224 Weight::from_parts(14_836_000, 4768)
225 .saturating_add(T::DbWeight::get().reads(1_u64))
226 .saturating_add(T::DbWeight::get().writes(1_u64))
227 }
228 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
229 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
230 fn thaw_asset() -> Weight {
231 // Proof Size summary in bytes:
232 // Measured: `276`
233 // Estimated: `4768`
234 // Minimum execution time: 14_153_000 picoseconds.
235 Weight::from_parts(14_778_000, 4768)
236 .saturating_add(T::DbWeight::get().reads(1_u64))
237 .saturating_add(T::DbWeight::get().writes(1_u64))
238 }
239 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
240 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
241 /// Storage: `ForeignAssets::Metadata` (r:1 w:0)
242 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
243 fn transfer_ownership() -> Weight {
244 // Proof Size summary in bytes:
245 // Measured: `242`
246 // Estimated: `4768`
247 // Minimum execution time: 14_025_000 picoseconds.
248 Weight::from_parts(14_436_000, 4768)
249 .saturating_add(T::DbWeight::get().reads(2_u64))
250 .saturating_add(T::DbWeight::get().writes(1_u64))
251 }
252 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
253 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
254 fn set_team() -> Weight {
255 // Proof Size summary in bytes:
256 // Measured: `242`
257 // Estimated: `4768`
258 // Minimum execution time: 12_065_000 picoseconds.
259 Weight::from_parts(12_685_000, 4768)
260 .saturating_add(T::DbWeight::get().reads(1_u64))
261 .saturating_add(T::DbWeight::get().writes(1_u64))
262 }
263 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
264 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
265 /// Storage: `ForeignAssets::Metadata` (r:1 w:1)
266 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
267 /// The range of component `n` is `[0, 50]`.
268 /// The range of component `s` is `[0, 50]`.
269 fn set_metadata(n: u32, s: u32, ) -> Weight {
270 // Proof Size summary in bytes:
271 // Measured: `242`
272 // Estimated: `4768`
273 // Minimum execution time: 16_790_000 picoseconds.
274 Weight::from_parts(17_655_839, 4768)
275 // Standard Error: 508
276 .saturating_add(Weight::from_parts(1_137, 0).saturating_mul(n.into()))
277 // Standard Error: 508
278 .saturating_add(Weight::from_parts(3_402, 0).saturating_mul(s.into()))
279 .saturating_add(T::DbWeight::get().reads(2_u64))
280 .saturating_add(T::DbWeight::get().writes(1_u64))
281 }
282 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
283 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
284 /// Storage: `ForeignAssets::Metadata` (r:1 w:1)
285 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
286 fn clear_metadata() -> Weight {
287 // Proof Size summary in bytes:
288 // Measured: `406`
289 // Estimated: `4768`
290 // Minimum execution time: 18_031_000 picoseconds.
291 Weight::from_parts(18_775_000, 4768)
292 .saturating_add(T::DbWeight::get().reads(2_u64))
293 .saturating_add(T::DbWeight::get().writes(1_u64))
294 }
295 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
296 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
297 /// Storage: `ForeignAssets::Metadata` (r:1 w:1)
298 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
299 /// The range of component `n` is `[0, 50]`.
300 /// The range of component `s` is `[0, 50]`.
301 fn force_set_metadata(n: u32, s: u32, ) -> Weight {
302 // Proof Size summary in bytes:
303 // Measured: `81`
304 // Estimated: `4768`
305 // Minimum execution time: 12_508_000 picoseconds.
306 Weight::from_parts(13_324_587, 4768)
307 // Standard Error: 384
308 .saturating_add(Weight::from_parts(851, 0).saturating_mul(n.into()))
309 // Standard Error: 384
310 .saturating_add(Weight::from_parts(2_151, 0).saturating_mul(s.into()))
311 .saturating_add(T::DbWeight::get().reads(2_u64))
312 .saturating_add(T::DbWeight::get().writes(1_u64))
313 }
314 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
315 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
316 /// Storage: `ForeignAssets::Metadata` (r:1 w:1)
317 /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`)
318 fn force_clear_metadata() -> Weight {
319 // Proof Size summary in bytes:
320 // Measured: `406`
321 // Estimated: `4768`
322 // Minimum execution time: 17_017_000 picoseconds.
323 Weight::from_parts(17_843_000, 4768)
324 .saturating_add(T::DbWeight::get().reads(2_u64))
325 .saturating_add(T::DbWeight::get().writes(1_u64))
326 }
327 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
328 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
329 fn force_asset_status() -> Weight {
330 // Proof Size summary in bytes:
331 // Measured: `242`
332 // Estimated: `4768`
333 // Minimum execution time: 11_563_000 picoseconds.
334 Weight::from_parts(11_979_000, 4768)
335 .saturating_add(T::DbWeight::get().reads(1_u64))
336 .saturating_add(T::DbWeight::get().writes(1_u64))
337 }
338 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
339 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
340 /// Storage: `ForeignAssets::Approvals` (r:1 w:1)
341 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
342 fn approve_transfer() -> Weight {
343 // Proof Size summary in bytes:
344 // Measured: `276`
345 // Estimated: `4768`
346 // Minimum execution time: 21_285_000 picoseconds.
347 Weight::from_parts(22_315_000, 4768)
348 .saturating_add(T::DbWeight::get().reads(2_u64))
349 .saturating_add(T::DbWeight::get().writes(2_u64))
350 }
351 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
352 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
353 /// Storage: `ForeignAssets::Approvals` (r:1 w:1)
354 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
355 /// Storage: `ForeignAssets::Account` (r:2 w:2)
356 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
357 /// Storage: `System::Account` (r:1 w:1)
358 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
359 fn transfer_approved() -> Weight {
360 // Proof Size summary in bytes:
361 // Measured: `559`
362 // Estimated: `7899`
363 // Minimum execution time: 59_155_000 picoseconds.
364 Weight::from_parts(60_775_000, 7899)
365 .saturating_add(T::DbWeight::get().reads(5_u64))
366 .saturating_add(T::DbWeight::get().writes(5_u64))
367 }
368 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
369 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
370 /// Storage: `ForeignAssets::Approvals` (r:1 w:1)
371 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
372 fn cancel_approval() -> Weight {
373 // Proof Size summary in bytes:
374 // Measured: `446`
375 // Estimated: `4768`
376 // Minimum execution time: 23_918_000 picoseconds.
377 Weight::from_parts(25_020_000, 4768)
378 .saturating_add(T::DbWeight::get().reads(2_u64))
379 .saturating_add(T::DbWeight::get().writes(2_u64))
380 }
381 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
382 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
383 /// Storage: `ForeignAssets::Approvals` (r:1 w:1)
384 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
385 fn force_cancel_approval() -> Weight {
386 // Proof Size summary in bytes:
387 // Measured: `446`
388 // Estimated: `4768`
389 // Minimum execution time: 24_252_000 picoseconds.
390 Weight::from_parts(25_041_000, 4768)
391 .saturating_add(T::DbWeight::get().reads(2_u64))
392 .saturating_add(T::DbWeight::get().writes(2_u64))
393 }
394 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
395 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
396 fn set_min_balance() -> Weight {
397 // Proof Size summary in bytes:
398 // Measured: `242`
399 // Estimated: `4768`
400 // Minimum execution time: 13_003_000 picoseconds.
401 Weight::from_parts(13_608_000, 4768)
402 .saturating_add(T::DbWeight::get().reads(1_u64))
403 .saturating_add(T::DbWeight::get().writes(1_u64))
404 }
405 /// Storage: `ForeignAssets::Account` (r:1 w:1)
406 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
407 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
408 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
409 fn touch() -> Weight {
410 // Proof Size summary in bytes:
411 // Measured: `242`
412 // Estimated: `4768`
413 // Minimum execution time: 18_452_000 picoseconds.
414 Weight::from_parts(18_913_000, 4768)
415 .saturating_add(T::DbWeight::get().reads(2_u64))
416 .saturating_add(T::DbWeight::get().writes(2_u64))
417 }
418 /// Storage: `ForeignAssets::Account` (r:1 w:1)
419 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
420 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
421 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
422 fn touch_other() -> Weight {
423 // Proof Size summary in bytes:
424 // Measured: `242`
425 // Estimated: `4768`
426 // Minimum execution time: 20_130_000 picoseconds.
427 Weight::from_parts(21_073_000, 4768)
428 .saturating_add(T::DbWeight::get().reads(2_u64))
429 .saturating_add(T::DbWeight::get().writes(2_u64))
430 }
431 /// Storage: `ForeignAssets::Account` (r:1 w:1)
432 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
433 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
434 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
435 fn refund() -> Weight {
436 // Proof Size summary in bytes:
437 // Measured: `368`
438 // Estimated: `4768`
439 // Minimum execution time: 18_613_000 picoseconds.
440 Weight::from_parts(19_537_000, 4768)
441 .saturating_add(T::DbWeight::get().reads(2_u64))
442 .saturating_add(T::DbWeight::get().writes(2_u64))
443 }
444 /// Storage: `ForeignAssets::Account` (r:1 w:1)
445 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
446 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
447 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
448 fn refund_other() -> Weight {
449 // Proof Size summary in bytes:
450 // Measured: `401`
451 // Estimated: `4768`
452 // Minimum execution time: 18_859_000 picoseconds.
453 Weight::from_parts(19_652_000, 4768)
454 .saturating_add(T::DbWeight::get().reads(2_u64))
455 .saturating_add(T::DbWeight::get().writes(2_u64))
456 }
457 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
458 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
459 /// Storage: `ForeignAssets::Account` (r:1 w:1)
460 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
461 fn block() -> Weight {
462 // Proof Size summary in bytes:
463 // Measured: `350`
464 // Estimated: `4768`
465 // Minimum execution time: 18_814_000 picoseconds.
466 Weight::from_parts(19_550_000, 4768)
467 .saturating_add(T::DbWeight::get().reads(2_u64))
468 .saturating_add(T::DbWeight::get().writes(1_u64))
469 }
470 /// Storage: `ForeignAssets::Asset` (r:1 w:1)
471 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
472 /// Storage: `ForeignAssets::Account` (r:2 w:2)
473 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
474 /// Storage: `System::Account` (r:1 w:1)
475 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
476 fn transfer_all() -> Weight {
477 // Proof Size summary in bytes:
478 // Measured: `389`
479 // Estimated: `7899`
480 // Minimum execution time: 58_911_000 picoseconds.
481 Weight::from_parts(60_118_000, 7899)
482 .saturating_add(T::DbWeight::get().reads(4_u64))
483 .saturating_add(T::DbWeight::get().writes(4_u64))
484 }
485 /// Storage: `ForeignAssets::Asset` (r:1 w:0)
486 /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
487 fn total_issuance() -> Weight {
488 // Proof Size summary in bytes:
489 // Measured: `276`
490 // Estimated: `4768`
491 // Minimum execution time: 7_189_000 picoseconds.
492 Weight::from_parts(7_608_000, 4768)
493 .saturating_add(T::DbWeight::get().reads(1_u64))
494 }
495 /// Storage: `ForeignAssets::Account` (r:1 w:0)
496 /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
497 fn balance() -> Weight {
498 // Proof Size summary in bytes:
499 // Measured: `150`
500 // Estimated: `4692`
501 // Minimum execution time: 8_115_000 picoseconds.
502 Weight::from_parts(8_813_000, 4692)
503 .saturating_add(T::DbWeight::get().reads(1_u64))
504 }
505 /// Storage: `ForeignAssets::Approvals` (r:1 w:0)
506 /// Proof: `ForeignAssets::Approvals` (`max_values`: None, `max_size`: Some(746), added: 3221, mode: `MaxEncodedLen`)
507 fn allowance() -> Weight {
508 // Proof Size summary in bytes:
509 // Measured: `245`
510 // Estimated: `4706`
511 // Minimum execution time: 10_938_000 picoseconds.
512 Weight::from_parts(11_379_000, 4706)
513 .saturating_add(T::DbWeight::get().reads(1_u64))
514 }
515}
516
517
518#[cfg(test)]
519mod tests {
520 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
521 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
522 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
523
524 #[allow(dead_code)]
525 struct BlockWeights;
526 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
527 fn get() -> frame_system::limits::BlockWeights {
528 frame_system::limits::BlockWeights::builder()
529 .base_block(Weight::zero())
530 .for_class(DispatchClass::all(), |weights| {
531 weights.base_extrinsic = ExtrinsicBaseWeight::get();
532 })
533 .for_class(DispatchClass::non_mandatory(), |weights| {
534 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
535 })
536 .build_or_panic()
537 }
538 }
539
540 #[test]
541 fn test_force_create() {
542 assert!(
543 BlockWeights::get()
544 .per_class
545 .get(frame_support::dispatch::DispatchClass::Normal)
546 .max_extrinsic
547 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
548 .proof_size()
549 > 4768
550 );
551 }
552 #[test]
553 fn test_start_destroy() {
554 assert!(
555 BlockWeights::get()
556 .per_class
557 .get(frame_support::dispatch::DispatchClass::Normal)
558 .max_extrinsic
559 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
560 .proof_size()
561 > 4768
562 );
563 }
564 #[test]
565 fn test_destroy_accounts() {
566 assert!(
567 BlockWeights::get()
568 .per_class
569 .get(frame_support::dispatch::DispatchClass::Normal)
570 .max_extrinsic
571 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
572 .proof_size()
573 > 4768
574 );
575 }
576 #[test]
577 fn test_destroy_approvals() {
578 assert!(
579 BlockWeights::get()
580 .per_class
581 .get(frame_support::dispatch::DispatchClass::Normal)
582 .max_extrinsic
583 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
584 .proof_size()
585 > 4768
586 );
587 }
588 #[test]
589 fn test_finish_destroy() {
590 assert!(
591 BlockWeights::get()
592 .per_class
593 .get(frame_support::dispatch::DispatchClass::Normal)
594 .max_extrinsic
595 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
596 .proof_size()
597 > 4768
598 );
599 }
600 #[test]
601 fn test_mint() {
602 assert!(
603 BlockWeights::get()
604 .per_class
605 .get(frame_support::dispatch::DispatchClass::Normal)
606 .max_extrinsic
607 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
608 .proof_size()
609 > 4768
610 );
611 }
612 #[test]
613 fn test_burn() {
614 assert!(
615 BlockWeights::get()
616 .per_class
617 .get(frame_support::dispatch::DispatchClass::Normal)
618 .max_extrinsic
619 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
620 .proof_size()
621 > 4768
622 );
623 }
624 #[test]
625 fn test_transfer() {
626 assert!(
627 BlockWeights::get()
628 .per_class
629 .get(frame_support::dispatch::DispatchClass::Normal)
630 .max_extrinsic
631 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
632 .proof_size()
633 > 7899
634 );
635 }
636 #[test]
637 fn test_transfer_keep_alive() {
638 assert!(
639 BlockWeights::get()
640 .per_class
641 .get(frame_support::dispatch::DispatchClass::Normal)
642 .max_extrinsic
643 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
644 .proof_size()
645 > 7899
646 );
647 }
648 #[test]
649 fn test_force_transfer() {
650 assert!(
651 BlockWeights::get()
652 .per_class
653 .get(frame_support::dispatch::DispatchClass::Normal)
654 .max_extrinsic
655 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
656 .proof_size()
657 > 7899
658 );
659 }
660 #[test]
661 fn test_freeze() {
662 assert!(
663 BlockWeights::get()
664 .per_class
665 .get(frame_support::dispatch::DispatchClass::Normal)
666 .max_extrinsic
667 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
668 .proof_size()
669 > 4768
670 );
671 }
672 #[test]
673 fn test_thaw() {
674 assert!(
675 BlockWeights::get()
676 .per_class
677 .get(frame_support::dispatch::DispatchClass::Normal)
678 .max_extrinsic
679 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
680 .proof_size()
681 > 4768
682 );
683 }
684 #[test]
685 fn test_freeze_asset() {
686 assert!(
687 BlockWeights::get()
688 .per_class
689 .get(frame_support::dispatch::DispatchClass::Normal)
690 .max_extrinsic
691 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
692 .proof_size()
693 > 4768
694 );
695 }
696 #[test]
697 fn test_thaw_asset() {
698 assert!(
699 BlockWeights::get()
700 .per_class
701 .get(frame_support::dispatch::DispatchClass::Normal)
702 .max_extrinsic
703 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
704 .proof_size()
705 > 4768
706 );
707 }
708 #[test]
709 fn test_transfer_ownership() {
710 assert!(
711 BlockWeights::get()
712 .per_class
713 .get(frame_support::dispatch::DispatchClass::Normal)
714 .max_extrinsic
715 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
716 .proof_size()
717 > 4768
718 );
719 }
720 #[test]
721 fn test_set_team() {
722 assert!(
723 BlockWeights::get()
724 .per_class
725 .get(frame_support::dispatch::DispatchClass::Normal)
726 .max_extrinsic
727 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
728 .proof_size()
729 > 4768
730 );
731 }
732 #[test]
733 fn test_set_metadata() {
734 assert!(
735 BlockWeights::get()
736 .per_class
737 .get(frame_support::dispatch::DispatchClass::Normal)
738 .max_extrinsic
739 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
740 .proof_size()
741 > 4768
742 );
743 }
744 #[test]
745 fn test_clear_metadata() {
746 assert!(
747 BlockWeights::get()
748 .per_class
749 .get(frame_support::dispatch::DispatchClass::Normal)
750 .max_extrinsic
751 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
752 .proof_size()
753 > 4768
754 );
755 }
756 #[test]
757 fn test_force_set_metadata() {
758 assert!(
759 BlockWeights::get()
760 .per_class
761 .get(frame_support::dispatch::DispatchClass::Normal)
762 .max_extrinsic
763 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
764 .proof_size()
765 > 4768
766 );
767 }
768 #[test]
769 fn test_force_clear_metadata() {
770 assert!(
771 BlockWeights::get()
772 .per_class
773 .get(frame_support::dispatch::DispatchClass::Normal)
774 .max_extrinsic
775 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
776 .proof_size()
777 > 4768
778 );
779 }
780 #[test]
781 fn test_force_asset_status() {
782 assert!(
783 BlockWeights::get()
784 .per_class
785 .get(frame_support::dispatch::DispatchClass::Normal)
786 .max_extrinsic
787 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
788 .proof_size()
789 > 4768
790 );
791 }
792 #[test]
793 fn test_approve_transfer() {
794 assert!(
795 BlockWeights::get()
796 .per_class
797 .get(frame_support::dispatch::DispatchClass::Normal)
798 .max_extrinsic
799 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
800 .proof_size()
801 > 4768
802 );
803 }
804 #[test]
805 fn test_transfer_approved() {
806 assert!(
807 BlockWeights::get()
808 .per_class
809 .get(frame_support::dispatch::DispatchClass::Normal)
810 .max_extrinsic
811 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
812 .proof_size()
813 > 7899
814 );
815 }
816 #[test]
817 fn test_cancel_approval() {
818 assert!(
819 BlockWeights::get()
820 .per_class
821 .get(frame_support::dispatch::DispatchClass::Normal)
822 .max_extrinsic
823 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
824 .proof_size()
825 > 4768
826 );
827 }
828 #[test]
829 fn test_force_cancel_approval() {
830 assert!(
831 BlockWeights::get()
832 .per_class
833 .get(frame_support::dispatch::DispatchClass::Normal)
834 .max_extrinsic
835 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
836 .proof_size()
837 > 4768
838 );
839 }
840 #[test]
841 fn test_set_min_balance() {
842 assert!(
843 BlockWeights::get()
844 .per_class
845 .get(frame_support::dispatch::DispatchClass::Normal)
846 .max_extrinsic
847 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
848 .proof_size()
849 > 4768
850 );
851 }
852 #[test]
853 fn test_touch() {
854 assert!(
855 BlockWeights::get()
856 .per_class
857 .get(frame_support::dispatch::DispatchClass::Normal)
858 .max_extrinsic
859 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
860 .proof_size()
861 > 4768
862 );
863 }
864 #[test]
865 fn test_touch_other() {
866 assert!(
867 BlockWeights::get()
868 .per_class
869 .get(frame_support::dispatch::DispatchClass::Normal)
870 .max_extrinsic
871 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
872 .proof_size()
873 > 4768
874 );
875 }
876 #[test]
877 fn test_refund() {
878 assert!(
879 BlockWeights::get()
880 .per_class
881 .get(frame_support::dispatch::DispatchClass::Normal)
882 .max_extrinsic
883 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
884 .proof_size()
885 > 4768
886 );
887 }
888 #[test]
889 fn test_refund_other() {
890 assert!(
891 BlockWeights::get()
892 .per_class
893 .get(frame_support::dispatch::DispatchClass::Normal)
894 .max_extrinsic
895 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
896 .proof_size()
897 > 4768
898 );
899 }
900 #[test]
901 fn test_block() {
902 assert!(
903 BlockWeights::get()
904 .per_class
905 .get(frame_support::dispatch::DispatchClass::Normal)
906 .max_extrinsic
907 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
908 .proof_size()
909 > 4768
910 );
911 }
912 #[test]
913 fn test_transfer_all() {
914 assert!(
915 BlockWeights::get()
916 .per_class
917 .get(frame_support::dispatch::DispatchClass::Normal)
918 .max_extrinsic
919 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
920 .proof_size()
921 > 7899
922 );
923 }
924 #[test]
925 fn test_total_issuance() {
926 assert!(
927 BlockWeights::get()
928 .per_class
929 .get(frame_support::dispatch::DispatchClass::Normal)
930 .max_extrinsic
931 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
932 .proof_size()
933 > 4768
934 );
935 }
936 #[test]
937 fn test_balance() {
938 assert!(
939 BlockWeights::get()
940 .per_class
941 .get(frame_support::dispatch::DispatchClass::Normal)
942 .max_extrinsic
943 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
944 .proof_size()
945 > 4692
946 );
947 }
948 #[test]
949 fn test_allowance() {
950 assert!(
951 BlockWeights::get()
952 .per_class
953 .get(frame_support::dispatch::DispatchClass::Normal)
954 .max_extrinsic
955 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
956 .proof_size()
957 > 4706
958 );
959 }
960}