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
//! Autogenerated weights for `pallet_treasury`
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
24
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25

            
26
// Executed Command:
27
// ./target/production/substrate-node
28
// benchmark
29
// pallet
30
// --chain=dev
31
// --steps=50
32
// --repeat=20
33
// --pallet=pallet_treasury
34
// --no-storage-info
35
// --no-median-slopes
36
// --no-min-squares
37
// --extrinsic=*
38
// --wasm-execution=compiled
39
// --heap-pages=4096
40
// --output=./substrate/frame/treasury/src/weights.rs
41
// --header=./substrate/HEADER-APACHE2
42
// --template=./substrate/.maintain/frame-weight-template.hbs
43

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

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

            
52
/// Weight functions needed for `pallet_treasury`.
53
pub trait WeightInfo {
54
	fn spend_local() -> Weight;
55
	fn remove_approval() -> Weight;
56
	fn on_initialize_proposals(p: u32, ) -> Weight;
57
	fn spend() -> Weight;
58
	fn payout() -> Weight;
59
	fn check_status() -> Weight;
60
	fn void_spend() -> Weight;
61
}
62

            
63
/// Weights for `pallet_treasury` using the Substrate node and recommended hardware.
64
pub struct SubstrateWeight<T>(PhantomData<T>);
65
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
66
	/// Storage: `Treasury::ProposalCount` (r:1 w:1)
67
	/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
68
	/// Storage: `Treasury::Approvals` (r:1 w:1)
69
	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
70
	/// Storage: `Treasury::Proposals` (r:0 w:1)
71
	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
72
	fn spend_local() -> Weight {
73
		// Proof Size summary in bytes:
74
		//  Measured:  `76`
75
		//  Estimated: `1887`
76
		// Minimum execution time: 11_910_000 picoseconds.
77
		Weight::from_parts(12_681_000, 1887)
78
			.saturating_add(T::DbWeight::get().reads(2_u64))
79
			.saturating_add(T::DbWeight::get().writes(3_u64))
80
	}
81
	/// Storage: Treasury Approvals (r:1 w:1)
82
	/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
83
	fn remove_approval() -> Weight {
84
		// Proof Size summary in bytes:
85
		//  Measured:  `161`
86
		//  Estimated: `1887`
87
		// Minimum execution time: 6_372_000 picoseconds.
88
		Weight::from_parts(6_567_000, 1887)
89
			.saturating_add(T::DbWeight::get().reads(1_u64))
90
			.saturating_add(T::DbWeight::get().writes(1_u64))
91
	}
92
	/// Storage: `Treasury::Deactivated` (r:1 w:1)
93
	/// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
94
	/// Storage: `Treasury::Approvals` (r:1 w:1)
95
	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
96
	/// Storage: `Treasury::Proposals` (r:99 w:99)
97
	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
98
	/// Storage: `System::Account` (r:198 w:198)
99
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
100
	/// Storage: `Bounties::BountyApprovals` (r:1 w:1)
101
	/// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
102
	/// The range of component `p` is `[0, 99]`.
103
	fn on_initialize_proposals(p: u32, ) -> Weight {
104
		// Proof Size summary in bytes:
105
		//  Measured:  `451 + p * (251 ±0)`
106
		//  Estimated: `1887 + p * (5206 ±0)`
107
		// Minimum execution time: 33_150_000 picoseconds.
108
		Weight::from_parts(41_451_020, 1887)
109
			// Standard Error: 19_018
110
			.saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
111
			.saturating_add(T::DbWeight::get().reads(3_u64))
112
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into())))
113
			.saturating_add(T::DbWeight::get().writes(3_u64))
114
			.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into())))
115
			.saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
116
	}
117
	/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
118
	/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
119
	/// Storage: `Treasury::SpendCount` (r:1 w:1)
120
	/// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
121
	/// Storage: `Treasury::Spends` (r:0 w:1)
122
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
123
	fn spend() -> Weight {
124
		// Proof Size summary in bytes:
125
		//  Measured:  `140`
126
		//  Estimated: `3501`
127
		// Minimum execution time: 14_233_000 picoseconds.
128
		Weight::from_parts(14_842_000, 3501)
129
			.saturating_add(T::DbWeight::get().reads(2_u64))
130
			.saturating_add(T::DbWeight::get().writes(2_u64))
131
	}
132
	/// Storage: `Treasury::Spends` (r:1 w:1)
133
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
134
	/// Storage: `Assets::Asset` (r:1 w:1)
135
	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
136
	/// Storage: `Assets::Account` (r:2 w:2)
137
	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
138
	/// Storage: `System::Account` (r:1 w:1)
139
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
140
	fn payout() -> Weight {
141
		// Proof Size summary in bytes:
142
		//  Measured:  `709`
143
		//  Estimated: `6208`
144
		// Minimum execution time: 58_857_000 picoseconds.
145
		Weight::from_parts(61_291_000, 6208)
146
			.saturating_add(T::DbWeight::get().reads(5_u64))
147
			.saturating_add(T::DbWeight::get().writes(5_u64))
148
	}
149
	/// Storage: `Treasury::Spends` (r:1 w:1)
150
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
151
	fn check_status() -> Weight {
152
		// Proof Size summary in bytes:
153
		//  Measured:  `198`
154
		//  Estimated: `3538`
155
		// Minimum execution time: 12_116_000 picoseconds.
156
		Weight::from_parts(12_480_000, 3538)
157
			.saturating_add(T::DbWeight::get().reads(1_u64))
158
			.saturating_add(T::DbWeight::get().writes(1_u64))
159
	}
160
	/// Storage: `Treasury::Spends` (r:1 w:1)
161
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
162
	fn void_spend() -> Weight {
163
		// Proof Size summary in bytes:
164
		//  Measured:  `198`
165
		//  Estimated: `3538`
166
		// Minimum execution time: 10_834_000 picoseconds.
167
		Weight::from_parts(11_427_000, 3538)
168
			.saturating_add(T::DbWeight::get().reads(1_u64))
169
			.saturating_add(T::DbWeight::get().writes(1_u64))
170
	}
171
}
172

            
173
// For backwards compatibility and tests.
174
impl WeightInfo for () {
175
	/// Storage: `Treasury::ProposalCount` (r:1 w:1)
176
	/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
177
	/// Storage: `Treasury::Approvals` (r:1 w:1)
178
	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
179
	/// Storage: `Treasury::Proposals` (r:0 w:1)
180
	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
181
	fn spend_local() -> Weight {
182
		// Proof Size summary in bytes:
183
		//  Measured:  `76`
184
		//  Estimated: `1887`
185
		// Minimum execution time: 11_910_000 picoseconds.
186
		Weight::from_parts(12_681_000, 1887)
187
			.saturating_add(RocksDbWeight::get().reads(2_u64))
188
			.saturating_add(RocksDbWeight::get().writes(3_u64))
189
	}
190
	/// Storage: Treasury Approvals (r:1 w:1)
191
	/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
192
	fn remove_approval() -> Weight {
193
		// Proof Size summary in bytes:
194
		//  Measured:  `161`
195
		//  Estimated: `1887`
196
		// Minimum execution time: 6_372_000 picoseconds.
197
		Weight::from_parts(6_567_000, 1887)
198
			.saturating_add(RocksDbWeight::get().reads(1_u64))
199
			.saturating_add(RocksDbWeight::get().writes(1_u64))
200
	}
201
	/// Storage: `Treasury::Deactivated` (r:1 w:1)
202
	/// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
203
	/// Storage: `Treasury::Approvals` (r:1 w:1)
204
	/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
205
	/// Storage: `Treasury::Proposals` (r:99 w:99)
206
	/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
207
	/// Storage: `System::Account` (r:198 w:198)
208
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
209
	/// Storage: `Bounties::BountyApprovals` (r:1 w:1)
210
	/// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
211
	/// The range of component `p` is `[0, 99]`.
212
	fn on_initialize_proposals(p: u32, ) -> Weight {
213
		// Proof Size summary in bytes:
214
		//  Measured:  `451 + p * (251 ±0)`
215
		//  Estimated: `1887 + p * (5206 ±0)`
216
		// Minimum execution time: 33_150_000 picoseconds.
217
		Weight::from_parts(41_451_020, 1887)
218
			// Standard Error: 19_018
219
			.saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
220
			.saturating_add(RocksDbWeight::get().reads(3_u64))
221
			.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(p.into())))
222
			.saturating_add(RocksDbWeight::get().writes(3_u64))
223
			.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(p.into())))
224
			.saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
225
	}
226
	/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
227
	/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
228
	/// Storage: `Treasury::SpendCount` (r:1 w:1)
229
	/// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
230
	/// Storage: `Treasury::Spends` (r:0 w:1)
231
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
232
	fn spend() -> Weight {
233
		// Proof Size summary in bytes:
234
		//  Measured:  `140`
235
		//  Estimated: `3501`
236
		// Minimum execution time: 14_233_000 picoseconds.
237
		Weight::from_parts(14_842_000, 3501)
238
			.saturating_add(RocksDbWeight::get().reads(2_u64))
239
			.saturating_add(RocksDbWeight::get().writes(2_u64))
240
	}
241
	/// Storage: `Treasury::Spends` (r:1 w:1)
242
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
243
	/// Storage: `Assets::Asset` (r:1 w:1)
244
	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
245
	/// Storage: `Assets::Account` (r:2 w:2)
246
	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
247
	/// Storage: `System::Account` (r:1 w:1)
248
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
249
	fn payout() -> Weight {
250
		// Proof Size summary in bytes:
251
		//  Measured:  `709`
252
		//  Estimated: `6208`
253
		// Minimum execution time: 58_857_000 picoseconds.
254
		Weight::from_parts(61_291_000, 6208)
255
			.saturating_add(RocksDbWeight::get().reads(5_u64))
256
			.saturating_add(RocksDbWeight::get().writes(5_u64))
257
	}
258
	/// Storage: `Treasury::Spends` (r:1 w:1)
259
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
260
	fn check_status() -> Weight {
261
		// Proof Size summary in bytes:
262
		//  Measured:  `198`
263
		//  Estimated: `3538`
264
		// Minimum execution time: 12_116_000 picoseconds.
265
		Weight::from_parts(12_480_000, 3538)
266
			.saturating_add(RocksDbWeight::get().reads(1_u64))
267
			.saturating_add(RocksDbWeight::get().writes(1_u64))
268
	}
269
	/// Storage: `Treasury::Spends` (r:1 w:1)
270
	/// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
271
	fn void_spend() -> Weight {
272
		// Proof Size summary in bytes:
273
		//  Measured:  `198`
274
		//  Estimated: `3538`
275
		// Minimum execution time: 10_834_000 picoseconds.
276
		Weight::from_parts(11_427_000, 3538)
277
			.saturating_add(RocksDbWeight::get().reads(1_u64))
278
			.saturating_add(RocksDbWeight::get().writes(1_u64))
279
	}
280
}