1
// Copyright 2019-2025 PureStake Inc.
2
// This file is part of Moonbeam.
3

            
4
// Moonbeam is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Moonbeam is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Moonbeam.  If not, see <http://www.gnu.org/licenses/>.
16

            
17

            
18
//! Autogenerated weights for pallet_asset_manager
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
21
//! DATE: 2023-04-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `benchmarker`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
24
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
25

            
26
// Executed Command:
27
// ./target/release/moonbeam
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// *
34
// --extrinsic
35
// *
36
// --steps
37
// 50
38
// --repeat
39
// 20
40
// --template=./benchmarking/frame-weight-template.hbs
41
// --json-file
42
// raw.json
43
// --output
44
// weights/
45

            
46
#![cfg_attr(rustfmt, rustfmt_skip)]
47
#![allow(unused_parens)]
48
#![allow(unused_imports)]
49

            
50
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
51
use sp_std::marker::PhantomData;
52

            
53
/// Weight functions needed for pallet_asset_manager.
54
pub trait WeightInfo {
55
	fn register_foreign_asset() -> Weight;
56
	fn change_existing_asset_type() -> Weight;
57
	fn remove_existing_asset_type() -> Weight;
58
}
59

            
60
/// Weights for pallet_asset_manager using the Substrate node and recommended hardware.
61
pub struct SubstrateWeight<T>(PhantomData<T>);
62
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
63
	/// Storage: AssetManager AssetIdType (r:1 w:1)
64
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
65
	/// Storage: Assets Asset (r:1 w:1)
66
	/// Proof: Assets Asset (max_values: None, max_size: Some(174), added: 2649, mode: MaxEncodedLen)
67
	/// Storage: Assets Metadata (r:1 w:1)
68
	/// Proof: Assets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen)
69
	/// Storage: AssetManager AssetTypeId (r:0 w:1)
70
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
71
	fn register_foreign_asset() -> Weight {
72
		// Proof Size summary in bytes:
73
		//  Measured:  `82`
74
		//  Estimated: `10885`
75
		// Minimum execution time: 51_631_000 picoseconds.
76
		Weight::from_parts(52_681_000, 10885)
77
			.saturating_add(T::DbWeight::get().reads(3_u64))
78
			.saturating_add(T::DbWeight::get().writes(4_u64))
79
	}
80
	/// Storage: AssetManager SupportedFeePaymentAssets (r:1 w:1)
81
	/// Proof Skipped: AssetManager SupportedFeePaymentAssets (max_values: Some(1), max_size: None, mode: Measured)
82
	/// Storage: AssetManager AssetIdType (r:1 w:1)
83
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
84
	/// Storage: AssetManager AssetTypeUnitsPerSecond (r:1 w:2)
85
	/// Proof Skipped: AssetManager AssetTypeUnitsPerSecond (max_values: None, max_size: None, mode: Measured)
86
	/// Storage: AssetManager AssetTypeId (r:0 w:2)
87
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
88
	/// The range of component `x` is `[5, 100]`.
89
	fn change_existing_asset_type() -> Weight {
90
		// Proof Size summary in bytes:
91
		//  Measured:  `926 + x * (13 ±0)`
92
		//  Estimated: `11791 + x * (60 ±0)`
93
		// Minimum execution time: 42_959_000 picoseconds.
94
		Weight::from_parts(43_255_055, 11791)
95
			// Standard Error: 3_394
96
			.saturating_add(Weight::from_parts(543_897, 0))
97
			.saturating_add(T::DbWeight::get().reads(3_u64))
98
			.saturating_add(T::DbWeight::get().writes(6_u64))
99
			.saturating_add(Weight::from_parts(0, 60))
100
	}
101
	/// Storage: AssetManager SupportedFeePaymentAssets (r:1 w:1)
102
	/// Proof Skipped: AssetManager SupportedFeePaymentAssets (max_values: Some(1), max_size: None, mode: Measured)
103
	/// Storage: AssetManager AssetIdType (r:1 w:1)
104
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
105
	/// Storage: AssetManager AssetTypeUnitsPerSecond (r:0 w:1)
106
	/// Proof Skipped: AssetManager AssetTypeUnitsPerSecond (max_values: None, max_size: None, mode: Measured)
107
	/// Storage: AssetManager AssetTypeId (r:0 w:1)
108
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
109
	/// The range of component `x` is `[5, 100]`.
110
	fn remove_existing_asset_type() -> Weight {
111
		// Proof Size summary in bytes:
112
		//  Measured:  `482 + x * (10 ±0)`
113
		//  Estimated: `6910 + x * (40 ±0)`
114
		// Minimum execution time: 32_960_000 picoseconds.
115
		Weight::from_parts(33_257_599, 6910)
116
			// Standard Error: 2_430
117
			.saturating_add(Weight::from_parts(421_651, 0))
118
			.saturating_add(T::DbWeight::get().reads(2_u64))
119
			.saturating_add(T::DbWeight::get().writes(4_u64))
120
			.saturating_add(Weight::from_parts(0, 40))
121
	}
122
}
123

            
124
// For backwards compatibility and tests
125
impl WeightInfo for () {
126
	/// Storage: AssetManager AssetIdType (r:1 w:1)
127
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
128
	/// Storage: Assets Asset (r:1 w:1)
129
	/// Proof: Assets Asset (max_values: None, max_size: Some(174), added: 2649, mode: MaxEncodedLen)
130
	/// Storage: Assets Metadata (r:1 w:1)
131
	/// Proof: Assets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen)
132
	/// Storage: AssetManager AssetTypeId (r:0 w:1)
133
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
134
	fn register_foreign_asset() -> Weight {
135
		// Proof Size summary in bytes:
136
		//  Measured:  `82`
137
		//  Estimated: `10885`
138
		// Minimum execution time: 51_631_000 picoseconds.
139
		Weight::from_parts(52_681_000, 10885)
140
			.saturating_add(RocksDbWeight::get().reads(3_u64))
141
			.saturating_add(RocksDbWeight::get().writes(4_u64))
142
	}
143
	/// Storage: AssetManager SupportedFeePaymentAssets (r:1 w:1)
144
	/// Proof Skipped: AssetManager SupportedFeePaymentAssets (max_values: Some(1), max_size: None, mode: Measured)
145
	/// Storage: AssetManager AssetIdType (r:1 w:1)
146
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
147
	/// Storage: AssetManager AssetTypeUnitsPerSecond (r:1 w:2)
148
	/// Proof Skipped: AssetManager AssetTypeUnitsPerSecond (max_values: None, max_size: None, mode: Measured)
149
	/// Storage: AssetManager AssetTypeId (r:0 w:2)
150
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
151
	/// The range of component `x` is `[5, 100]`.
152
	fn change_existing_asset_type() -> Weight {
153
		// Proof Size summary in bytes:
154
		//  Measured:  `926 + x * (13 ±0)`
155
		//  Estimated: `11791 + x * (60 ±0)`
156
		// Minimum execution time: 42_959_000 picoseconds.
157
		Weight::from_parts(43_255_055, 11791)
158
			// Standard Error: 3_394
159
			.saturating_add(Weight::from_parts(543_897, 0))
160
			.saturating_add(RocksDbWeight::get().reads(3_u64))
161
			.saturating_add(RocksDbWeight::get().writes(6_u64))
162
			.saturating_add(Weight::from_parts(0, 60))
163
	}
164
	/// Storage: AssetManager SupportedFeePaymentAssets (r:1 w:1)
165
	/// Proof Skipped: AssetManager SupportedFeePaymentAssets (max_values: Some(1), max_size: None, mode: Measured)
166
	/// Storage: AssetManager AssetIdType (r:1 w:1)
167
	/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
168
	/// Storage: AssetManager AssetTypeUnitsPerSecond (r:0 w:1)
169
	/// Proof Skipped: AssetManager AssetTypeUnitsPerSecond (max_values: None, max_size: None, mode: Measured)
170
	/// Storage: AssetManager AssetTypeId (r:0 w:1)
171
	/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
172
	/// The range of component `x` is `[5, 100]`.
173
	fn remove_existing_asset_type() -> Weight {
174
		// Proof Size summary in bytes:
175
		//  Measured:  `482 + x * (10 ±0)`
176
		//  Estimated: `6910 + x * (40 ±0)`
177
		// Minimum execution time: 32_960_000 picoseconds.
178
		Weight::from_parts(33_257_599, 6910)
179
			// Standard Error: 2_430
180
			.saturating_add(Weight::from_parts(421_651, 0))
181
			.saturating_add(RocksDbWeight::get().reads(2_u64))
182
			.saturating_add(RocksDbWeight::get().writes(4_u64))
183
			.saturating_add(Weight::from_parts(0, 40))
184
	}
185
}