1
// Copyright 2024 Moonbeam Foundation.
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
//! Autogenerated weights for pallet_foreign_asset_creator
18
//!
19
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21
//! WORST CASE MAP SIZE: `1000000`
22
//! HOSTNAME: `girazoki-XPS-15-9530`, CPU: `13th Gen Intel(R) Core(TM) i9-13900H`
23
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
24

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

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

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

            
52
/// Weight functions needed for pallet_foreign_asset_creator.
53
pub trait WeightInfo {
54
	fn create_foreign_asset() -> Weight;
55
	fn change_xcm_location() -> Weight;
56
	fn freeze_foreign_asset() -> Weight;
57
	fn unfreeze_foreign_asset() -> Weight;
58
}
59

            
60
/// Weights for pallet_foreign_asset_creator 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: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
64
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
65
	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
66
	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
67
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
68
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
69
	fn create_foreign_asset() -> Weight {
70
		// Proof Size summary in bytes:
71
		//  Measured:  `113`
72
		//  Estimated: `3673`
73
		// Minimum execution time: 16_738_000 picoseconds.
74
		Weight::from_parts(17_366_000, 3673)
75
			.saturating_add(T::DbWeight::get().reads(2_u64))
76
			.saturating_add(T::DbWeight::get().writes(3_u64))
77
	}
78
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
79
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
80
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:2)
81
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
82
	fn change_xcm_location() -> Weight {
83
		// Proof Size summary in bytes:
84
		//  Measured:  `189`
85
		//  Estimated: `3654`
86
		// Minimum execution time: 13_861_000 picoseconds.
87
		Weight::from_parts(14_153_000, 3654)
88
			.saturating_add(T::DbWeight::get().reads(1_u64))
89
			.saturating_add(T::DbWeight::get().writes(3_u64))
90
	}
91
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
92
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
93
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
94
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
95
	fn freeze_foreign_asset() -> Weight {
96
		// Proof Size summary in bytes:
97
		//  Measured:  `189`
98
		//  Estimated: `3654`
99
		// Minimum execution time: 11_698_000 picoseconds.
100
		Weight::from_parts(12_184_000, 3654)
101
			.saturating_add(T::DbWeight::get().reads(1_u64))
102
			.saturating_add(T::DbWeight::get().writes(2_u64))
103
	}
104
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
105
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
106
	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
107
	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
108
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
109
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
110
	fn unfreeze_foreign_asset() -> Weight {
111
		// Proof Size summary in bytes:
112
		//  Measured:  `429`
113
		//  Estimated: `3894`
114
		// Minimum execution time: 17_797_000 picoseconds.
115
		Weight::from_parts(18_635_000, 3894)
116
			.saturating_add(T::DbWeight::get().reads(2_u64))
117
			.saturating_add(T::DbWeight::get().writes(3_u64))
118
	}
119
}
120

            
121
// For backwards compatibility and tests
122
impl WeightInfo for () {
123
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
124
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
125
	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
126
	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
127
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
128
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
129
	fn create_foreign_asset() -> Weight {
130
		// Proof Size summary in bytes:
131
		//  Measured:  `113`
132
		//  Estimated: `3673`
133
		// Minimum execution time: 16_738_000 picoseconds.
134
		Weight::from_parts(17_366_000, 3673)
135
			.saturating_add(RocksDbWeight::get().reads(2_u64))
136
			.saturating_add(RocksDbWeight::get().writes(3_u64))
137
	}
138
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
139
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
140
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:2)
141
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
142
	fn change_xcm_location() -> Weight {
143
		// Proof Size summary in bytes:
144
		//  Measured:  `189`
145
		//  Estimated: `3654`
146
		// Minimum execution time: 13_861_000 picoseconds.
147
		Weight::from_parts(14_153_000, 3654)
148
			.saturating_add(RocksDbWeight::get().reads(1_u64))
149
			.saturating_add(RocksDbWeight::get().writes(3_u64))
150
	}
151
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
152
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
153
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
154
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
155
	fn freeze_foreign_asset() -> Weight {
156
		// Proof Size summary in bytes:
157
		//  Measured:  `189`
158
		//  Estimated: `3654`
159
		// Minimum execution time: 11_698_000 picoseconds.
160
		Weight::from_parts(12_184_000, 3654)
161
			.saturating_add(RocksDbWeight::get().reads(1_u64))
162
			.saturating_add(RocksDbWeight::get().writes(2_u64))
163
	}
164
	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
165
	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
166
	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
167
	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
168
	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
169
	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
170
	fn unfreeze_foreign_asset() -> Weight {
171
		// Proof Size summary in bytes:
172
		//  Measured:  `429`
173
		//  Estimated: `3894`
174
		// Minimum execution time: 17_797_000 picoseconds.
175
		Weight::from_parts(18_635_000, 3894)
176
			.saturating_add(RocksDbWeight::get().reads(2_u64))
177
			.saturating_add(RocksDbWeight::get().writes(3_u64))
178
	}
179
}