pallet_moonbeam_foreign_assets/
weights.rs

1// Copyright 2025 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
49use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50use sp_std::marker::PhantomData;
51
52/// Weight functions needed for pallet_foreign_asset_creator.
53pub 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.
61pub struct SubstrateWeight<T>(PhantomData<T>);
62impl<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
79
80	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
81	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
82	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:2)
83	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
84	fn change_xcm_location() -> Weight {
85		// Proof Size summary in bytes:
86		//  Measured:  `189`
87		//  Estimated: `3654`
88		// Minimum execution time: 13_861_000 picoseconds.
89		Weight::from_parts(14_153_000, 3654)
90			.saturating_add(T::DbWeight::get().reads(1_u64))
91			.saturating_add(T::DbWeight::get().writes(3_u64))
92	}
93	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
94	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
95	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
96	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
97	fn freeze_foreign_asset() -> Weight {
98		// Proof Size summary in bytes:
99		//  Measured:  `189`
100		//  Estimated: `3654`
101		// Minimum execution time: 11_698_000 picoseconds.
102		Weight::from_parts(12_184_000, 3654)
103			.saturating_add(T::DbWeight::get().reads(1_u64))
104			.saturating_add(T::DbWeight::get().writes(2_u64))
105	}
106	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
107	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
108	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
109	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
110	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
111	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
112	fn unfreeze_foreign_asset() -> Weight {
113		// Proof Size summary in bytes:
114		//  Measured:  `429`
115		//  Estimated: `3894`
116		// Minimum execution time: 17_797_000 picoseconds.
117		Weight::from_parts(18_635_000, 3894)
118			.saturating_add(T::DbWeight::get().reads(2_u64))
119			.saturating_add(T::DbWeight::get().writes(3_u64))
120	}
121}
122
123// For backwards compatibility and tests
124impl WeightInfo for () {
125	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
126	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
127	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
128	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
129	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
130	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
131	fn create_foreign_asset() -> Weight {
132		// Proof Size summary in bytes:
133		//  Measured:  `113`
134		//  Estimated: `3673`
135		// Minimum execution time: 16_738_000 picoseconds.
136		Weight::from_parts(17_366_000, 3673)
137			.saturating_add(RocksDbWeight::get().reads(2_u64))
138			.saturating_add(RocksDbWeight::get().writes(3_u64))
139	}
140	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
141	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
142	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:2)
143	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
144	fn change_xcm_location() -> Weight {
145		// Proof Size summary in bytes:
146		//  Measured:  `189`
147		//  Estimated: `3654`
148		// Minimum execution time: 13_861_000 picoseconds.
149		Weight::from_parts(14_153_000, 3654)
150			.saturating_add(RocksDbWeight::get().reads(1_u64))
151			.saturating_add(RocksDbWeight::get().writes(3_u64))
152	}
153	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
154	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
155	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
156	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
157	fn freeze_foreign_asset() -> Weight {
158		// Proof Size summary in bytes:
159		//  Measured:  `189`
160		//  Estimated: `3654`
161		// Minimum execution time: 11_698_000 picoseconds.
162		Weight::from_parts(12_184_000, 3654)
163			.saturating_add(RocksDbWeight::get().reads(1_u64))
164			.saturating_add(RocksDbWeight::get().writes(2_u64))
165	}
166	/// Storage: `ForeignAssetsCreator::AssetIdToForeignAsset` (r:1 w:1)
167	/// Proof: `ForeignAssetsCreator::AssetIdToForeignAsset` (`max_values`: None, `max_size`: None, mode: `Measured`)
168	/// Storage: `ForeignAssets::Asset` (r:1 w:1)
169	/// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(208), added: 2683, mode: `MaxEncodedLen`)
170	/// Storage: `ForeignAssetsCreator::ForeignAssetToAssetId` (r:0 w:1)
171	/// Proof: `ForeignAssetsCreator::ForeignAssetToAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`)
172	fn unfreeze_foreign_asset() -> Weight {
173		// Proof Size summary in bytes:
174		//  Measured:  `429`
175		//  Estimated: `3894`
176		// Minimum execution time: 17_797_000 picoseconds.
177		Weight::from_parts(18_635_000, 3894)
178			.saturating_add(RocksDbWeight::get().reads(2_u64))
179			.saturating_add(RocksDbWeight::get().writes(3_u64))
180	}
181}