1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi 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
// Tanssi 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 Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17

            
18
//! Autogenerated weights for pallet_services_payment
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
21
//! DATE: 2024-12-31, STEPS: `16`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `tomasz-XPS-15-9520`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// ./target/release/tanssi-node
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_services_payment
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 16
39
// --repeat
40
// 1
41
// --template=benchmarking/frame-weight-pallet-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/pallet_services_payment.rs
46

            
47
#![cfg_attr(rustfmt, rustfmt_skip)]
48
#![allow(unused_parens)]
49
#![allow(unused_imports)]
50

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

            
54
/// Weight functions needed for pallet_services_payment.
55
pub trait WeightInfo {
56
	fn purchase_credits() -> Weight;
57
	fn set_block_production_credits() -> Weight;
58
	fn set_given_free_credits() -> Weight;
59
	fn set_refund_address() -> Weight;
60
	fn set_max_core_price() -> Weight;
61
	fn on_container_authors_noted(n: u32, ) -> Weight;
62
	fn on_collators_assigned() -> Weight;
63
	fn set_max_tip() -> Weight;
64
}
65

            
66
/// Weights for pallet_services_payment using the Substrate node and recommended hardware.
67
pub struct SubstrateWeight<T>(PhantomData<T>);
68
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
69
	/// Storage: `System::Account` (r:2 w:2)
70
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
71
	fn purchase_credits() -> Weight {
72
		// Proof Size summary in bytes:
73
		//  Measured:  `155`
74
		//  Estimated: `6196`
75
		// Minimum execution time: 45_102_000 picoseconds.
76
		Weight::from_parts(45_102_000, 6196)
77
			.saturating_add(T::DbWeight::get().reads(2_u64))
78
			.saturating_add(T::DbWeight::get().writes(2_u64))
79
	}
80
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:0 w:1)
81
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
82
	fn set_block_production_credits() -> Weight {
83
		// Proof Size summary in bytes:
84
		//  Measured:  `0`
85
		//  Estimated: `0`
86
		// Minimum execution time: 6_864_000 picoseconds.
87
		Weight::from_parts(6_864_000, 0)
88
			.saturating_add(T::DbWeight::get().writes(1_u64))
89
	}
90
	/// Storage: `ServicesPayment::GivenFreeCredits` (r:0 w:1)
91
	/// Proof: `ServicesPayment::GivenFreeCredits` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
92
	fn set_given_free_credits() -> Weight {
93
		// Proof Size summary in bytes:
94
		//  Measured:  `0`
95
		//  Estimated: `0`
96
		// Minimum execution time: 5_076_000 picoseconds.
97
		Weight::from_parts(5_076_000, 0)
98
			.saturating_add(T::DbWeight::get().writes(1_u64))
99
	}
100
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
101
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
102
	/// Storage: `ServicesPayment::RefundAddress` (r:0 w:1)
103
	/// Proof: `ServicesPayment::RefundAddress` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
104
	fn set_refund_address() -> Weight {
105
		// Proof Size summary in bytes:
106
		//  Measured:  `220`
107
		//  Estimated: `3517`
108
		// Minimum execution time: 12_430_000 picoseconds.
109
		Weight::from_parts(12_430_000, 3517)
110
			.saturating_add(T::DbWeight::get().reads(1_u64))
111
			.saturating_add(T::DbWeight::get().writes(1_u64))
112
	}
113
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
114
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
115
	/// Storage: `ServicesPayment::MaxCorePrice` (r:0 w:1)
116
	/// Proof: `ServicesPayment::MaxCorePrice` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
117
	fn set_max_core_price() -> Weight {
118
		// Proof Size summary in bytes:
119
		//  Measured:  `220`
120
		//  Estimated: `3517`
121
		// Minimum execution time: 12_141_000 picoseconds.
122
		Weight::from_parts(12_141_000, 3517)
123
			.saturating_add(T::DbWeight::get().reads(1_u64))
124
			.saturating_add(T::DbWeight::get().writes(1_u64))
125
	}
126
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:50 w:0)
127
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
128
	/// Storage: `System::Account` (r:50 w:50)
129
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
130
	/// The range of component `n` is `[1, 50]`.
131
	fn on_container_authors_noted(n: u32, ) -> Weight {
132
		// Proof Size summary in bytes:
133
		//  Measured:  `300 + n * (132 ±0)`
134
		//  Estimated: `990 + n * (2603 ±0)`
135
		// Minimum execution time: 20_800_000 picoseconds.
136
		Weight::from_parts(8_063_256, 990)
137
			// Standard Error: 289_417
138
			.saturating_add(Weight::from_parts(14_388_705, 0).saturating_mul(n.into()))
139
			.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
140
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
141
			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into()))
142
	}
143
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:1 w:0)
144
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
145
	/// Storage: `System::Account` (r:1 w:1)
146
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
147
	/// Storage: `ServicesPayment::MaxTip` (r:1 w:0)
148
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
149
	fn on_collators_assigned() -> Weight {
150
		// Proof Size summary in bytes:
151
		//  Measured:  `315`
152
		//  Estimated: `3593`
153
		// Minimum execution time: 36_282_000 picoseconds.
154
		Weight::from_parts(36_282_000, 3593)
155
			.saturating_add(T::DbWeight::get().reads(3_u64))
156
			.saturating_add(T::DbWeight::get().writes(1_u64))
157
	}
158
	/// Storage: `ServicesPayment::MaxTip` (r:0 w:1)
159
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
160
	fn set_max_tip() -> Weight {
161
		// Proof Size summary in bytes:
162
		//  Measured:  `0`
163
		//  Estimated: `0`
164
		// Minimum execution time: 5_832_000 picoseconds.
165
		Weight::from_parts(5_832_000, 0)
166
			.saturating_add(T::DbWeight::get().writes(1_u64))
167
	}
168
}
169

            
170
// For backwards compatibility and tests
171
impl WeightInfo for () {
172
	/// Storage: `System::Account` (r:2 w:2)
173
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
174
	fn purchase_credits() -> Weight {
175
		// Proof Size summary in bytes:
176
		//  Measured:  `155`
177
		//  Estimated: `6196`
178
		// Minimum execution time: 45_102_000 picoseconds.
179
		Weight::from_parts(45_102_000, 6196)
180
			.saturating_add(RocksDbWeight::get().reads(2_u64))
181
			.saturating_add(RocksDbWeight::get().writes(2_u64))
182
	}
183
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:0 w:1)
184
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
185
	fn set_block_production_credits() -> Weight {
186
		// Proof Size summary in bytes:
187
		//  Measured:  `0`
188
		//  Estimated: `0`
189
		// Minimum execution time: 6_864_000 picoseconds.
190
		Weight::from_parts(6_864_000, 0)
191
			.saturating_add(RocksDbWeight::get().writes(1_u64))
192
	}
193
	/// Storage: `ServicesPayment::GivenFreeCredits` (r:0 w:1)
194
	/// Proof: `ServicesPayment::GivenFreeCredits` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
195
	fn set_given_free_credits() -> Weight {
196
		// Proof Size summary in bytes:
197
		//  Measured:  `0`
198
		//  Estimated: `0`
199
		// Minimum execution time: 5_076_000 picoseconds.
200
		Weight::from_parts(5_076_000, 0)
201
			.saturating_add(RocksDbWeight::get().writes(1_u64))
202
	}
203
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
204
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
205
	/// Storage: `ServicesPayment::RefundAddress` (r:0 w:1)
206
	/// Proof: `ServicesPayment::RefundAddress` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
207
	fn set_refund_address() -> Weight {
208
		// Proof Size summary in bytes:
209
		//  Measured:  `220`
210
		//  Estimated: `3517`
211
		// Minimum execution time: 12_430_000 picoseconds.
212
		Weight::from_parts(12_430_000, 3517)
213
			.saturating_add(RocksDbWeight::get().reads(1_u64))
214
			.saturating_add(RocksDbWeight::get().writes(1_u64))
215
	}
216
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
217
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
218
	/// Storage: `ServicesPayment::MaxCorePrice` (r:0 w:1)
219
	/// Proof: `ServicesPayment::MaxCorePrice` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
220
	fn set_max_core_price() -> Weight {
221
		// Proof Size summary in bytes:
222
		//  Measured:  `220`
223
		//  Estimated: `3517`
224
		// Minimum execution time: 12_141_000 picoseconds.
225
		Weight::from_parts(12_141_000, 3517)
226
			.saturating_add(RocksDbWeight::get().reads(1_u64))
227
			.saturating_add(RocksDbWeight::get().writes(1_u64))
228
	}
229
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:50 w:0)
230
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
231
	/// Storage: `System::Account` (r:50 w:50)
232
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
233
	/// The range of component `n` is `[1, 50]`.
234
4
	fn on_container_authors_noted(n: u32, ) -> Weight {
235
4
		// Proof Size summary in bytes:
236
4
		//  Measured:  `300 + n * (132 ±0)`
237
4
		//  Estimated: `990 + n * (2603 ±0)`
238
4
		// Minimum execution time: 20_800_000 picoseconds.
239
4
		Weight::from_parts(8_063_256, 990)
240
4
			// Standard Error: 289_417
241
4
			.saturating_add(Weight::from_parts(14_388_705, 0).saturating_mul(n.into()))
242
4
			.saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(n.into())))
243
4
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
244
4
			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into()))
245
4
	}
246
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:1 w:0)
247
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
248
	/// Storage: `System::Account` (r:1 w:1)
249
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
250
	/// Storage: `ServicesPayment::MaxTip` (r:1 w:0)
251
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
252
1
	fn on_collators_assigned() -> Weight {
253
1
		// Proof Size summary in bytes:
254
1
		//  Measured:  `315`
255
1
		//  Estimated: `3593`
256
1
		// Minimum execution time: 36_282_000 picoseconds.
257
1
		Weight::from_parts(36_282_000, 3593)
258
1
			.saturating_add(RocksDbWeight::get().reads(3_u64))
259
1
			.saturating_add(RocksDbWeight::get().writes(1_u64))
260
1
	}
261
	/// Storage: `ServicesPayment::MaxTip` (r:0 w:1)
262
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
263
	fn set_max_tip() -> Weight {
264
		// Proof Size summary in bytes:
265
		//  Measured:  `0`
266
		//  Estimated: `0`
267
		// Minimum execution time: 5_832_000 picoseconds.
268
		Weight::from_parts(5_832_000, 0)
269
			.saturating_add(RocksDbWeight::get().writes(1_u64))
270
	}
271
}