referrerpolicy=no-referrer-when-downgrade

pallet_treasury/
weights.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// 	http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_treasury`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_treasury
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/treasury/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_treasury`.
74pub trait WeightInfo {
75	fn spend_local() -> Weight;
76	fn remove_approval() -> Weight;
77	fn on_initialize_proposals(p: u32, ) -> Weight;
78	fn spend() -> Weight;
79	fn payout() -> Weight;
80	fn check_status() -> Weight;
81	fn void_spend() -> Weight;
82}
83
84/// Weights for `pallet_treasury` using the Substrate node and recommended hardware.
85pub struct SubstrateWeight<T>(PhantomData<T>);
86impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
87	/// Storage: `Treasury::ProposalCount` (r:1 w:1)
88	/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
89	/// Storage: `Treasury::Approvals` (r:1 w:1)
90	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
91	/// Storage: `Treasury::Proposals` (r:0 w:1)
92	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
93	fn spend_local() -> Weight {
94		// Proof Size summary in bytes:
95		//  Measured:  `0`
96		//  Estimated: `1887`
97		// Minimum execution time: 9_084_000 picoseconds.
98		Weight::from_parts(9_260_000, 1887)
99			.saturating_add(T::DbWeight::get().reads(2_u64))
100			.saturating_add(T::DbWeight::get().writes(3_u64))
101	}
102	/// Storage: `Treasury::Approvals` (r:1 w:1)
103	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
104	fn remove_approval() -> Weight {
105		// Proof Size summary in bytes:
106		//  Measured:  `69`
107		//  Estimated: `1887`
108		// Minimum execution time: 5_149_000 picoseconds.
109		Weight::from_parts(5_358_000, 1887)
110			.saturating_add(T::DbWeight::get().reads(1_u64))
111			.saturating_add(T::DbWeight::get().writes(1_u64))
112	}
113	/// Storage: `Treasury::Deactivated` (r:1 w:1)
114	/// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
115	/// Storage: `Treasury::LastSpendPeriod` (r:1 w:1)
116	/// Proof: `Treasury::LastSpendPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
117	/// The range of component `p` is `[0, 99]`.
118	fn on_initialize_proposals(p: u32, ) -> Weight {
119		// Proof Size summary in bytes:
120		//  Measured:  `78`
121		//  Estimated: `1501`
122		// Minimum execution time: 8_211_000 picoseconds.
123		Weight::from_parts(11_324_784, 1501)
124			// Standard Error: 806
125			.saturating_add(Weight::from_parts(45_246, 0).saturating_mul(p.into()))
126			.saturating_add(T::DbWeight::get().reads(2_u64))
127			.saturating_add(T::DbWeight::get().writes(2_u64))
128	}
129	/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
130	/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
131	/// Storage: `Treasury::SpendCount` (r:1 w:1)
132	/// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
133	/// Storage: `Treasury::Spends` (r:0 w:1)
134	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
135	fn spend() -> Weight {
136		// Proof Size summary in bytes:
137		//  Measured:  `42`
138		//  Estimated: `3502`
139		// Minimum execution time: 11_348_000 picoseconds.
140		Weight::from_parts(11_874_000, 3502)
141			.saturating_add(T::DbWeight::get().reads(2_u64))
142			.saturating_add(T::DbWeight::get().writes(2_u64))
143	}
144	/// Storage: `Treasury::Spends` (r:1 w:1)
145	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
146	/// Storage: `Assets::Asset` (r:1 w:1)
147	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
148	/// Storage: `Assets::Account` (r:2 w:2)
149	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, 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 payout() -> Weight {
153		// Proof Size summary in bytes:
154		//  Measured:  `473`
155		//  Estimated: `6208`
156		// Minimum execution time: 55_665_000 picoseconds.
157		Weight::from_parts(57_099_000, 6208)
158			.saturating_add(T::DbWeight::get().reads(5_u64))
159			.saturating_add(T::DbWeight::get().writes(5_u64))
160	}
161	/// Storage: `Treasury::Spends` (r:1 w:1)
162	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
163	fn check_status() -> Weight {
164		// Proof Size summary in bytes:
165		//  Measured:  `143`
166		//  Estimated: `3539`
167		// Minimum execution time: 12_058_000 picoseconds.
168		Weight::from_parts(12_297_000, 3539)
169			.saturating_add(T::DbWeight::get().reads(1_u64))
170			.saturating_add(T::DbWeight::get().writes(1_u64))
171	}
172	/// Storage: `Treasury::Spends` (r:1 w:1)
173	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
174	fn void_spend() -> Weight {
175		// Proof Size summary in bytes:
176		//  Measured:  `144`
177		//  Estimated: `3539`
178		// Minimum execution time: 10_730_000 picoseconds.
179		Weight::from_parts(10_908_000, 3539)
180			.saturating_add(T::DbWeight::get().reads(1_u64))
181			.saturating_add(T::DbWeight::get().writes(1_u64))
182	}
183}
184
185// For backwards compatibility and tests.
186impl WeightInfo for () {
187	/// Storage: `Treasury::ProposalCount` (r:1 w:1)
188	/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
189	/// Storage: `Treasury::Approvals` (r:1 w:1)
190	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
191	/// Storage: `Treasury::Proposals` (r:0 w:1)
192	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
193	fn spend_local() -> Weight {
194		// Proof Size summary in bytes:
195		//  Measured:  `0`
196		//  Estimated: `1887`
197		// Minimum execution time: 9_084_000 picoseconds.
198		Weight::from_parts(9_260_000, 1887)
199			.saturating_add(RocksDbWeight::get().reads(2_u64))
200			.saturating_add(RocksDbWeight::get().writes(3_u64))
201	}
202	/// Storage: `Treasury::Approvals` (r:1 w:1)
203	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
204	fn remove_approval() -> Weight {
205		// Proof Size summary in bytes:
206		//  Measured:  `69`
207		//  Estimated: `1887`
208		// Minimum execution time: 5_149_000 picoseconds.
209		Weight::from_parts(5_358_000, 1887)
210			.saturating_add(RocksDbWeight::get().reads(1_u64))
211			.saturating_add(RocksDbWeight::get().writes(1_u64))
212	}
213	/// Storage: `Treasury::Deactivated` (r:1 w:1)
214	/// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
215	/// Storage: `Treasury::LastSpendPeriod` (r:1 w:1)
216	/// Proof: `Treasury::LastSpendPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
217	/// The range of component `p` is `[0, 99]`.
218	fn on_initialize_proposals(p: u32, ) -> Weight {
219		// Proof Size summary in bytes:
220		//  Measured:  `78`
221		//  Estimated: `1501`
222		// Minimum execution time: 8_211_000 picoseconds.
223		Weight::from_parts(11_324_784, 1501)
224			// Standard Error: 806
225			.saturating_add(Weight::from_parts(45_246, 0).saturating_mul(p.into()))
226			.saturating_add(RocksDbWeight::get().reads(2_u64))
227			.saturating_add(RocksDbWeight::get().writes(2_u64))
228	}
229	/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
230	/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
231	/// Storage: `Treasury::SpendCount` (r:1 w:1)
232	/// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
233	/// Storage: `Treasury::Spends` (r:0 w:1)
234	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
235	fn spend() -> Weight {
236		// Proof Size summary in bytes:
237		//  Measured:  `42`
238		//  Estimated: `3502`
239		// Minimum execution time: 11_348_000 picoseconds.
240		Weight::from_parts(11_874_000, 3502)
241			.saturating_add(RocksDbWeight::get().reads(2_u64))
242			.saturating_add(RocksDbWeight::get().writes(2_u64))
243	}
244	/// Storage: `Treasury::Spends` (r:1 w:1)
245	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
246	/// Storage: `Assets::Asset` (r:1 w:1)
247	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
248	/// Storage: `Assets::Account` (r:2 w:2)
249	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
250	/// Storage: `System::Account` (r:1 w:1)
251	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
252	fn payout() -> Weight {
253		// Proof Size summary in bytes:
254		//  Measured:  `473`
255		//  Estimated: `6208`
256		// Minimum execution time: 55_665_000 picoseconds.
257		Weight::from_parts(57_099_000, 6208)
258			.saturating_add(RocksDbWeight::get().reads(5_u64))
259			.saturating_add(RocksDbWeight::get().writes(5_u64))
260	}
261	/// Storage: `Treasury::Spends` (r:1 w:1)
262	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
263	fn check_status() -> Weight {
264		// Proof Size summary in bytes:
265		//  Measured:  `143`
266		//  Estimated: `3539`
267		// Minimum execution time: 12_058_000 picoseconds.
268		Weight::from_parts(12_297_000, 3539)
269			.saturating_add(RocksDbWeight::get().reads(1_u64))
270			.saturating_add(RocksDbWeight::get().writes(1_u64))
271	}
272	/// Storage: `Treasury::Spends` (r:1 w:1)
273	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
274	fn void_spend() -> Weight {
275		// Proof Size summary in bytes:
276		//  Measured:  `144`
277		//  Estimated: `3539`
278		// Minimum execution time: 10_730_000 picoseconds.
279		Weight::from_parts(10_908_000, 3539)
280			.saturating_add(RocksDbWeight::get().reads(1_u64))
281			.saturating_add(RocksDbWeight::get().writes(1_u64))
282	}
283}