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_balances`
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-05-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `runner-unxyhko3-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
// --steps=50
31
// --repeat=20
32
// --extrinsic=*
33
// --wasm-execution=compiled
34
// --heap-pages=4096
35
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
36
// --pallet=pallet_balances
37
// --chain=dev
38
// --header=./substrate/HEADER-APACHE2
39
// --output=./substrate/frame/balances/src/weights.rs
40
// --template=./substrate/.maintain/frame-weight-template.hbs
41

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

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

            
50
/// Weight functions needed for `pallet_balances`.
51
pub trait WeightInfo {
52
	fn transfer_allow_death() -> Weight;
53
	fn transfer_keep_alive() -> Weight;
54
	fn force_set_balance_creating() -> Weight;
55
	fn force_set_balance_killing() -> Weight;
56
	fn force_transfer() -> Weight;
57
	fn transfer_all() -> Weight;
58
	fn force_unreserve() -> Weight;
59
	fn upgrade_accounts(u: u32, ) -> Weight;
60
	fn force_adjust_total_issuance() -> Weight;
61
	fn burn_allow_death() -> Weight;
62
	fn burn_keep_alive() -> Weight;
63
}
64

            
65
/// Weights for `pallet_balances` using the Substrate node and recommended hardware.
66
pub struct SubstrateWeight<T>(PhantomData<T>);
67
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
68
	/// Storage: `System::Account` (r:1 w:1)
69
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
70
	fn transfer_allow_death() -> Weight {
71
		// Proof Size summary in bytes:
72
		//  Measured:  `0`
73
		//  Estimated: `3593`
74
		// Minimum execution time: 47_552_000 picoseconds.
75
		Weight::from_parts(48_363_000, 3593)
76
			.saturating_add(T::DbWeight::get().reads(1_u64))
77
			.saturating_add(T::DbWeight::get().writes(1_u64))
78
	}
79
	/// Storage: `System::Account` (r:1 w:1)
80
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
81
	fn transfer_keep_alive() -> Weight {
82
		// Proof Size summary in bytes:
83
		//  Measured:  `0`
84
		//  Estimated: `3593`
85
		// Minimum execution time: 37_565_000 picoseconds.
86
		Weight::from_parts(38_159_000, 3593)
87
			.saturating_add(T::DbWeight::get().reads(1_u64))
88
			.saturating_add(T::DbWeight::get().writes(1_u64))
89
	}
90
	/// Storage: `System::Account` (r:1 w:1)
91
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
92
	fn force_set_balance_creating() -> Weight {
93
		// Proof Size summary in bytes:
94
		//  Measured:  `174`
95
		//  Estimated: `3593`
96
		// Minimum execution time: 14_147_000 picoseconds.
97
		Weight::from_parts(14_687_000, 3593)
98
			.saturating_add(T::DbWeight::get().reads(1_u64))
99
			.saturating_add(T::DbWeight::get().writes(1_u64))
100
	}
101
	/// Storage: `System::Account` (r:1 w:1)
102
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
103
	fn force_set_balance_killing() -> Weight {
104
		// Proof Size summary in bytes:
105
		//  Measured:  `174`
106
		//  Estimated: `3593`
107
		// Minimum execution time: 19_188_000 picoseconds.
108
		Weight::from_parts(19_929_000, 3593)
109
			.saturating_add(T::DbWeight::get().reads(1_u64))
110
			.saturating_add(T::DbWeight::get().writes(1_u64))
111
	}
112
	/// Storage: `System::Account` (r:2 w:2)
113
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
114
	fn force_transfer() -> Weight {
115
		// Proof Size summary in bytes:
116
		//  Measured:  `103`
117
		//  Estimated: `6196`
118
		// Minimum execution time: 48_903_000 picoseconds.
119
		Weight::from_parts(49_944_000, 6196)
120
			.saturating_add(T::DbWeight::get().reads(2_u64))
121
			.saturating_add(T::DbWeight::get().writes(2_u64))
122
	}
123
	/// Storage: `System::Account` (r:1 w:1)
124
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
125
	fn transfer_all() -> Weight {
126
		// Proof Size summary in bytes:
127
		//  Measured:  `0`
128
		//  Estimated: `3593`
129
		// Minimum execution time: 46_573_000 picoseconds.
130
		Weight::from_parts(47_385_000, 3593)
131
			.saturating_add(T::DbWeight::get().reads(1_u64))
132
			.saturating_add(T::DbWeight::get().writes(1_u64))
133
	}
134
	/// Storage: `System::Account` (r:1 w:1)
135
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
136
	fn force_unreserve() -> Weight {
137
		// Proof Size summary in bytes:
138
		//  Measured:  `174`
139
		//  Estimated: `3593`
140
		// Minimum execution time: 16_750_000 picoseconds.
141
		Weight::from_parts(17_233_000, 3593)
142
			.saturating_add(T::DbWeight::get().reads(1_u64))
143
			.saturating_add(T::DbWeight::get().writes(1_u64))
144
	}
145
	/// Storage: `System::Account` (r:999 w:999)
146
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
147
	/// The range of component `u` is `[1, 1000]`.
148
	fn upgrade_accounts(u: u32, ) -> Weight {
149
		// Proof Size summary in bytes:
150
		//  Measured:  `0 + u * (135 ±0)`
151
		//  Estimated: `990 + u * (2603 ±0)`
152
		// Minimum execution time: 16_333_000 picoseconds.
153
		Weight::from_parts(16_588_000, 990)
154
			// Standard Error: 12_254
155
			.saturating_add(Weight::from_parts(13_973_659, 0).saturating_mul(u.into()))
156
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
157
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
158
			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
159
	}
160
	fn force_adjust_total_issuance() -> Weight {
161
		// Proof Size summary in bytes:
162
		//  Measured:  `0`
163
		//  Estimated: `0`
164
		// Minimum execution time: 6_265_000 picoseconds.
165
		Weight::from_parts(6_594_000, 0)
166
	}
167
	fn burn_allow_death() -> Weight {
168
		// Proof Size summary in bytes:
169
		//  Measured:  `0`
170
		//  Estimated: `0`
171
		// Minimum execution time: 30_151_000 picoseconds.
172
		Weight::from_parts(30_968_000, 0)
173
	}
174
	fn burn_keep_alive() -> Weight {
175
		// Proof Size summary in bytes:
176
		//  Measured:  `0`
177
		//  Estimated: `0`
178
		// Minimum execution time: 20_055_000 picoseconds.
179
		Weight::from_parts(20_711_000, 0)
180
	}
181
}
182

            
183
// For backwards compatibility and tests.
184
impl WeightInfo for () {
185
	/// Storage: `System::Account` (r:1 w:1)
186
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
187
	fn transfer_allow_death() -> Weight {
188
		// Proof Size summary in bytes:
189
		//  Measured:  `0`
190
		//  Estimated: `3593`
191
		// Minimum execution time: 47_552_000 picoseconds.
192
		Weight::from_parts(48_363_000, 3593)
193
			.saturating_add(RocksDbWeight::get().reads(1_u64))
194
			.saturating_add(RocksDbWeight::get().writes(1_u64))
195
	}
196
	/// Storage: `System::Account` (r:1 w:1)
197
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
198
	fn transfer_keep_alive() -> Weight {
199
		// Proof Size summary in bytes:
200
		//  Measured:  `0`
201
		//  Estimated: `3593`
202
		// Minimum execution time: 37_565_000 picoseconds.
203
		Weight::from_parts(38_159_000, 3593)
204
			.saturating_add(RocksDbWeight::get().reads(1_u64))
205
			.saturating_add(RocksDbWeight::get().writes(1_u64))
206
	}
207
	/// Storage: `System::Account` (r:1 w:1)
208
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
209
	fn force_set_balance_creating() -> Weight {
210
		// Proof Size summary in bytes:
211
		//  Measured:  `174`
212
		//  Estimated: `3593`
213
		// Minimum execution time: 14_147_000 picoseconds.
214
		Weight::from_parts(14_687_000, 3593)
215
			.saturating_add(RocksDbWeight::get().reads(1_u64))
216
			.saturating_add(RocksDbWeight::get().writes(1_u64))
217
	}
218
	/// Storage: `System::Account` (r:1 w:1)
219
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
220
	fn force_set_balance_killing() -> Weight {
221
		// Proof Size summary in bytes:
222
		//  Measured:  `174`
223
		//  Estimated: `3593`
224
		// Minimum execution time: 19_188_000 picoseconds.
225
		Weight::from_parts(19_929_000, 3593)
226
			.saturating_add(RocksDbWeight::get().reads(1_u64))
227
			.saturating_add(RocksDbWeight::get().writes(1_u64))
228
	}
229
	/// Storage: `System::Account` (r:2 w:2)
230
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
231
	fn force_transfer() -> Weight {
232
		// Proof Size summary in bytes:
233
		//  Measured:  `103`
234
		//  Estimated: `6196`
235
		// Minimum execution time: 48_903_000 picoseconds.
236
		Weight::from_parts(49_944_000, 6196)
237
			.saturating_add(RocksDbWeight::get().reads(2_u64))
238
			.saturating_add(RocksDbWeight::get().writes(2_u64))
239
	}
240
	/// Storage: `System::Account` (r:1 w:1)
241
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
242
	fn transfer_all() -> Weight {
243
		// Proof Size summary in bytes:
244
		//  Measured:  `0`
245
		//  Estimated: `3593`
246
		// Minimum execution time: 46_573_000 picoseconds.
247
		Weight::from_parts(47_385_000, 3593)
248
			.saturating_add(RocksDbWeight::get().reads(1_u64))
249
			.saturating_add(RocksDbWeight::get().writes(1_u64))
250
	}
251
	/// Storage: `System::Account` (r:1 w:1)
252
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
253
	fn force_unreserve() -> Weight {
254
		// Proof Size summary in bytes:
255
		//  Measured:  `174`
256
		//  Estimated: `3593`
257
		// Minimum execution time: 16_750_000 picoseconds.
258
		Weight::from_parts(17_233_000, 3593)
259
			.saturating_add(RocksDbWeight::get().reads(1_u64))
260
			.saturating_add(RocksDbWeight::get().writes(1_u64))
261
	}
262
	/// Storage: `System::Account` (r:999 w:999)
263
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
264
	/// The range of component `u` is `[1, 1000]`.
265
	fn upgrade_accounts(u: u32, ) -> Weight {
266
		// Proof Size summary in bytes:
267
		//  Measured:  `0 + u * (135 ±0)`
268
		//  Estimated: `990 + u * (2603 ±0)`
269
		// Minimum execution time: 16_333_000 picoseconds.
270
		Weight::from_parts(16_588_000, 990)
271
			// Standard Error: 12_254
272
			.saturating_add(Weight::from_parts(13_973_659, 0).saturating_mul(u.into()))
273
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(u.into())))
274
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(u.into())))
275
			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
276
	}
277
	fn force_adjust_total_issuance() -> Weight {
278
		// Proof Size summary in bytes:
279
		//  Measured:  `0`
280
		//  Estimated: `0`
281
		// Minimum execution time: 6_265_000 picoseconds.
282
		Weight::from_parts(6_594_000, 0)
283
	}
284
	fn burn_allow_death() -> Weight {
285
		// Proof Size summary in bytes:
286
		//  Measured:  `0`
287
		//  Estimated: `0`
288
		// Minimum execution time: 30_151_000 picoseconds.
289
		Weight::from_parts(30_968_000, 0)
290
	}
291
	fn burn_keep_alive() -> Weight {
292
		// Proof Size summary in bytes:
293
		//  Measured:  `0`
294
		//  Estimated: `0`
295
		// Minimum execution time: 20_055_000 picoseconds.
296
		Weight::from_parts(20_711_000, 0)
297
	}
298
}