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 4.0.0-dev
21
//! DATE: 2024-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
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
// 50
39
// --repeat
40
// 20
41
// --template=./benchmarking/frame-weight-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/dancebox_weights/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_author_noted() -> 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: 57_174_000 picoseconds.
76
		Weight::from_parts(57_971_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: 8_445_000 picoseconds.
87
		Weight::from_parts(8_713_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: 4_842_000 picoseconds.
97
		Weight::from_parts(5_122_000, 0)
98
			.saturating_add(T::DbWeight::get().writes(1_u64))
99
	}
100
	/// Storage: `Registrar::RegistrarDeposit` (r:1 w:0)
101
	/// Proof: `Registrar::RegistrarDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
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:  `195`
107
		//  Estimated: `3660`
108
		// Minimum execution time: 16_357_000 picoseconds.
109
		Weight::from_parts(16_871_000, 3660)
110
			.saturating_add(T::DbWeight::get().reads(1_u64))
111
			.saturating_add(T::DbWeight::get().writes(1_u64))
112
	}
113
	/// Storage: `Registrar::RegistrarDeposit` (r:1 w:0)
114
	/// Proof: `Registrar::RegistrarDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
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:  `195`
120
		//  Estimated: `3660`
121
		// Minimum execution time: 8_773_000 picoseconds.
122
		Weight::from_parts(9_211_000, 3660)
123
			.saturating_add(T::DbWeight::get().reads(1_u64))
124
			.saturating_add(T::DbWeight::get().writes(1_u64))
125
	}
126
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
127
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
128
	/// Storage: `System::Account` (r:1 w:1)
129
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
130
	fn on_container_author_noted() -> Weight {
131
		// Proof Size summary in bytes:
132
		//  Measured:  `258`
133
		//  Estimated: `3593`
134
		// Minimum execution time: 24_336_000 picoseconds.
135
		Weight::from_parts(24_786_000, 3593)
136
			.saturating_add(T::DbWeight::get().reads(2_u64))
137
			.saturating_add(T::DbWeight::get().writes(1_u64))
138
	}
139
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:1 w:0)
140
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
141
	/// Storage: `System::Account` (r:1 w:1)
142
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
143
	fn on_collators_assigned() -> Weight {
144
		// Proof Size summary in bytes:
145
		//  Measured:  `258`
146
		//  Estimated: `3593`
147
		// Minimum execution time: 24_209_000 picoseconds.
148
		Weight::from_parts(24_682_000, 3593)
149
			.saturating_add(T::DbWeight::get().reads(2_u64))
150
			.saturating_add(T::DbWeight::get().writes(1_u64))
151
	}
152
	/// Storage: `ServicesPayment::MaxTip` (r:0 w:1)
153
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
154
	fn set_max_tip() -> Weight {
155
		// Proof Size summary in bytes:
156
		//  Measured:  `0`
157
		//  Estimated: `0`
158
		// Minimum execution time: 4_157_000 picoseconds.
159
		Weight::from_parts(4_576_000, 0)
160
			.saturating_add(T::DbWeight::get().writes(1_u64))
161
	}
162
}
163

            
164
// For backwards compatibility and tests
165
impl WeightInfo for () {
166
	/// Storage: `System::Account` (r:2 w:2)
167
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
168
	fn purchase_credits() -> Weight {
169
		// Proof Size summary in bytes:
170
		//  Measured:  `155`
171
		//  Estimated: `6196`
172
		// Minimum execution time: 57_174_000 picoseconds.
173
		Weight::from_parts(57_971_000, 6196)
174
			.saturating_add(RocksDbWeight::get().reads(2_u64))
175
			.saturating_add(RocksDbWeight::get().writes(2_u64))
176
	}
177
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:0 w:1)
178
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
179
	fn set_block_production_credits() -> Weight {
180
		// Proof Size summary in bytes:
181
		//  Measured:  `0`
182
		//  Estimated: `0`
183
		// Minimum execution time: 8_445_000 picoseconds.
184
		Weight::from_parts(8_713_000, 0)
185
			.saturating_add(RocksDbWeight::get().writes(1_u64))
186
	}
187
	/// Storage: `ServicesPayment::GivenFreeCredits` (r:0 w:1)
188
	/// Proof: `ServicesPayment::GivenFreeCredits` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
189
	fn set_given_free_credits() -> Weight {
190
		// Proof Size summary in bytes:
191
		//  Measured:  `0`
192
		//  Estimated: `0`
193
		// Minimum execution time: 4_842_000 picoseconds.
194
		Weight::from_parts(5_122_000, 0)
195
			.saturating_add(RocksDbWeight::get().writes(1_u64))
196
	}
197
	/// Storage: `Registrar::RegistrarDeposit` (r:1 w:0)
198
	/// Proof: `Registrar::RegistrarDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
199
	/// Storage: `ServicesPayment::RefundAddress` (r:0 w:1)
200
	/// Proof: `ServicesPayment::RefundAddress` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
201
	fn set_refund_address() -> Weight {
202
		// Proof Size summary in bytes:
203
		//  Measured:  `195`
204
		//  Estimated: `3660`
205
		// Minimum execution time: 16_357_000 picoseconds.
206
		Weight::from_parts(16_871_000, 3660)
207
			.saturating_add(RocksDbWeight::get().reads(1_u64))
208
			.saturating_add(RocksDbWeight::get().writes(1_u64))
209
	}
210
	/// Storage: `Registrar::RegistrarDeposit` (r:1 w:0)
211
	/// Proof: `Registrar::RegistrarDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
212
	/// Storage: `ServicesPayment::MaxCorePrice` (r:0 w:1)
213
	/// Proof: `ServicesPayment::MaxCorePrice` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
214
	fn set_max_core_price() -> Weight {
215
		// Proof Size summary in bytes:
216
		//  Measured:  `195`
217
		//  Estimated: `3660`
218
		// Minimum execution time: 8_773_000 picoseconds.
219
		Weight::from_parts(9_211_000, 3660)
220
			.saturating_add(RocksDbWeight::get().reads(1_u64))
221
			.saturating_add(RocksDbWeight::get().writes(1_u64))
222
	}
223
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
224
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
225
	/// Storage: `System::Account` (r:1 w:1)
226
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
227
4
	fn on_container_author_noted() -> Weight {
228
4
		// Proof Size summary in bytes:
229
4
		//  Measured:  `258`
230
4
		//  Estimated: `3593`
231
4
		// Minimum execution time: 24_336_000 picoseconds.
232
4
		Weight::from_parts(24_786_000, 3593)
233
4
			.saturating_add(RocksDbWeight::get().reads(2_u64))
234
4
			.saturating_add(RocksDbWeight::get().writes(1_u64))
235
4
	}
236
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:1 w:0)
237
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
238
	/// Storage: `System::Account` (r:1 w:1)
239
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
240
1
	fn on_collators_assigned() -> Weight {
241
1
		// Proof Size summary in bytes:
242
1
		//  Measured:  `258`
243
1
		//  Estimated: `3593`
244
1
		// Minimum execution time: 24_209_000 picoseconds.
245
1
		Weight::from_parts(24_682_000, 3593)
246
1
			.saturating_add(RocksDbWeight::get().reads(2_u64))
247
1
			.saturating_add(RocksDbWeight::get().writes(1_u64))
248
1
	}
249
	/// Storage: `ServicesPayment::MaxTip` (r:0 w:1)
250
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
251
	fn set_max_tip() -> Weight {
252
		// Proof Size summary in bytes:
253
		//  Measured:  `0`
254
		//  Estimated: `0`
255
		// Minimum execution time: 4_157_000 picoseconds.
256
		Weight::from_parts(4_576_000, 0)
257
			.saturating_add(RocksDbWeight::get().writes(1_u64))
258
	}
259
}