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_stream_payment
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
21
//! DATE: 2024-02-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
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_stream_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/pallet_stream_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_stream_payment.
55
pub trait WeightInfo {
56
	fn open_stream() -> Weight;
57
	fn close_stream() -> Weight;
58
	fn perform_payment() -> Weight;
59
	fn request_change_immediate() -> Weight;
60
	fn request_change_delayed() -> Weight;
61
	fn accept_requested_change() -> Weight;
62
	fn cancel_change_request() -> Weight;
63
	fn immediately_change_deposit() -> Weight;
64
}
65

            
66
/// Weights for pallet_stream_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: `StreamPayment::NextStreamId` (r:1 w:1)
70
	/// Proof: `StreamPayment::NextStreamId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
71
	/// Storage: `System::Account` (r:1 w:1)
72
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
73
	/// Storage: `Balances::Holds` (r:1 w:1)
74
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
75
	/// Storage: `StreamPayment::LookupStreamsWithTarget` (r:0 w:1)
76
	/// Proof: `StreamPayment::LookupStreamsWithTarget` (`max_values`: None, `max_size`: None, mode: `Measured`)
77
	/// Storage: `StreamPayment::LookupStreamsWithSource` (r:0 w:1)
78
	/// Proof: `StreamPayment::LookupStreamsWithSource` (`max_values`: None, `max_size`: None, mode: `Measured`)
79
	/// Storage: `StreamPayment::Streams` (r:0 w:1)
80
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
81
	fn open_stream() -> Weight {
82
		// Proof Size summary in bytes:
83
		//  Measured:  `107`
84
		//  Estimated: `3694`
85
		// Minimum execution time: 49_066_000 picoseconds.
86
		Weight::from_parts(55_468_000, 3694)
87
			.saturating_add(T::DbWeight::get().reads(3_u64))
88
			.saturating_add(T::DbWeight::get().writes(6_u64))
89
	}
90
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
91
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
92
	/// Storage: `System::Account` (r:2 w:2)
93
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
94
	/// Storage: `Balances::Holds` (r:1 w:1)
95
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
96
	/// Storage: `StreamPayment::LookupStreamsWithTarget` (r:0 w:1)
97
	/// Proof: `StreamPayment::LookupStreamsWithTarget` (`max_values`: None, `max_size`: None, mode: `Measured`)
98
	/// Storage: `StreamPayment::LookupStreamsWithSource` (r:0 w:1)
99
	/// Proof: `StreamPayment::LookupStreamsWithSource` (`max_values`: None, `max_size`: None, mode: `Measured`)
100
	fn close_stream() -> Weight {
101
		// Proof Size summary in bytes:
102
		//  Measured:  `580`
103
		//  Estimated: `6196`
104
		// Minimum execution time: 113_779_000 picoseconds.
105
		Weight::from_parts(116_675_000, 6196)
106
			.saturating_add(T::DbWeight::get().reads(4_u64))
107
			.saturating_add(T::DbWeight::get().writes(6_u64))
108
	}
109
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
110
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
111
	/// Storage: `System::Account` (r:2 w:2)
112
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
113
	/// Storage: `Balances::Holds` (r:1 w:1)
114
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
115
	fn perform_payment() -> Weight {
116
		// Proof Size summary in bytes:
117
		//  Measured:  `580`
118
		//  Estimated: `6196`
119
		// Minimum execution time: 82_466_000 picoseconds.
120
		Weight::from_parts(85_659_000, 6196)
121
			.saturating_add(T::DbWeight::get().reads(4_u64))
122
			.saturating_add(T::DbWeight::get().writes(4_u64))
123
	}
124
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
125
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
126
	/// Storage: `System::Account` (r:2 w:2)
127
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
128
	/// Storage: `Balances::Holds` (r:1 w:1)
129
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
130
	fn request_change_immediate() -> Weight {
131
		// Proof Size summary in bytes:
132
		//  Measured:  `580`
133
		//  Estimated: `6196`
134
		// Minimum execution time: 98_788_000 picoseconds.
135
		Weight::from_parts(187_700_000, 6196)
136
			.saturating_add(T::DbWeight::get().reads(4_u64))
137
			.saturating_add(T::DbWeight::get().writes(4_u64))
138
	}
139
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
140
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
141
	fn request_change_delayed() -> Weight {
142
		// Proof Size summary in bytes:
143
		//  Measured:  `248`
144
		//  Estimated: `3713`
145
		// Minimum execution time: 11_772_000 picoseconds.
146
		Weight::from_parts(13_209_000, 3713)
147
			.saturating_add(T::DbWeight::get().reads(1_u64))
148
			.saturating_add(T::DbWeight::get().writes(1_u64))
149
	}
150
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
151
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
152
	/// Storage: `System::Account` (r:2 w:2)
153
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
154
	/// Storage: `Balances::Holds` (r:1 w:1)
155
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
156
	fn accept_requested_change() -> Weight {
157
		// Proof Size summary in bytes:
158
		//  Measured:  `618`
159
		//  Estimated: `6196`
160
		// Minimum execution time: 90_231_000 picoseconds.
161
		Weight::from_parts(138_090_000, 6196)
162
			.saturating_add(T::DbWeight::get().reads(4_u64))
163
			.saturating_add(T::DbWeight::get().writes(4_u64))
164
	}
165
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
166
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
167
	fn cancel_change_request() -> Weight {
168
		// Proof Size summary in bytes:
169
		//  Measured:  `286`
170
		//  Estimated: `3751`
171
		// Minimum execution time: 9_140_000 picoseconds.
172
		Weight::from_parts(13_298_000, 3751)
173
			.saturating_add(T::DbWeight::get().reads(1_u64))
174
			.saturating_add(T::DbWeight::get().writes(1_u64))
175
	}
176
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
177
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
178
	/// Storage: `System::Account` (r:2 w:2)
179
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
180
	/// Storage: `Balances::Holds` (r:1 w:1)
181
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
182
	fn immediately_change_deposit() -> Weight {
183
		// Proof Size summary in bytes:
184
		//  Measured:  `580`
185
		//  Estimated: `6196`
186
		// Minimum execution time: 84_809_000 picoseconds.
187
		Weight::from_parts(104_948_000, 6196)
188
			.saturating_add(T::DbWeight::get().reads(4_u64))
189
			.saturating_add(T::DbWeight::get().writes(4_u64))
190
	}
191
}
192

            
193
// For backwards compatibility and tests
194
impl WeightInfo for () {
195
	/// Storage: `StreamPayment::NextStreamId` (r:1 w:1)
196
	/// Proof: `StreamPayment::NextStreamId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
197
	/// Storage: `System::Account` (r:1 w:1)
198
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
199
	/// Storage: `Balances::Holds` (r:1 w:1)
200
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
201
	/// Storage: `StreamPayment::LookupStreamsWithTarget` (r:0 w:1)
202
	/// Proof: `StreamPayment::LookupStreamsWithTarget` (`max_values`: None, `max_size`: None, mode: `Measured`)
203
	/// Storage: `StreamPayment::LookupStreamsWithSource` (r:0 w:1)
204
	/// Proof: `StreamPayment::LookupStreamsWithSource` (`max_values`: None, `max_size`: None, mode: `Measured`)
205
	/// Storage: `StreamPayment::Streams` (r:0 w:1)
206
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
207
	fn open_stream() -> Weight {
208
		// Proof Size summary in bytes:
209
		//  Measured:  `107`
210
		//  Estimated: `3694`
211
		// Minimum execution time: 49_066_000 picoseconds.
212
		Weight::from_parts(55_468_000, 3694)
213
			.saturating_add(RocksDbWeight::get().reads(3_u64))
214
			.saturating_add(RocksDbWeight::get().writes(6_u64))
215
	}
216
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
217
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
218
	/// Storage: `System::Account` (r:2 w:2)
219
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
220
	/// Storage: `Balances::Holds` (r:1 w:1)
221
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
222
	/// Storage: `StreamPayment::LookupStreamsWithTarget` (r:0 w:1)
223
	/// Proof: `StreamPayment::LookupStreamsWithTarget` (`max_values`: None, `max_size`: None, mode: `Measured`)
224
	/// Storage: `StreamPayment::LookupStreamsWithSource` (r:0 w:1)
225
	/// Proof: `StreamPayment::LookupStreamsWithSource` (`max_values`: None, `max_size`: None, mode: `Measured`)
226
	fn close_stream() -> Weight {
227
		// Proof Size summary in bytes:
228
		//  Measured:  `580`
229
		//  Estimated: `6196`
230
		// Minimum execution time: 113_779_000 picoseconds.
231
		Weight::from_parts(116_675_000, 6196)
232
			.saturating_add(RocksDbWeight::get().reads(4_u64))
233
			.saturating_add(RocksDbWeight::get().writes(6_u64))
234
	}
235
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
236
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
237
	/// Storage: `System::Account` (r:2 w:2)
238
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
239
	/// Storage: `Balances::Holds` (r:1 w:1)
240
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
241
	fn perform_payment() -> Weight {
242
		// Proof Size summary in bytes:
243
		//  Measured:  `580`
244
		//  Estimated: `6196`
245
		// Minimum execution time: 82_466_000 picoseconds.
246
		Weight::from_parts(85_659_000, 6196)
247
			.saturating_add(RocksDbWeight::get().reads(4_u64))
248
			.saturating_add(RocksDbWeight::get().writes(4_u64))
249
	}
250
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
251
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
252
	/// Storage: `System::Account` (r:2 w:2)
253
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
254
	/// Storage: `Balances::Holds` (r:1 w:1)
255
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
256
	fn request_change_immediate() -> Weight {
257
		// Proof Size summary in bytes:
258
		//  Measured:  `580`
259
		//  Estimated: `6196`
260
		// Minimum execution time: 98_788_000 picoseconds.
261
		Weight::from_parts(187_700_000, 6196)
262
			.saturating_add(RocksDbWeight::get().reads(4_u64))
263
			.saturating_add(RocksDbWeight::get().writes(4_u64))
264
	}
265
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
266
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
267
	fn request_change_delayed() -> Weight {
268
		// Proof Size summary in bytes:
269
		//  Measured:  `248`
270
		//  Estimated: `3713`
271
		// Minimum execution time: 11_772_000 picoseconds.
272
		Weight::from_parts(13_209_000, 3713)
273
			.saturating_add(RocksDbWeight::get().reads(1_u64))
274
			.saturating_add(RocksDbWeight::get().writes(1_u64))
275
	}
276
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
277
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
278
	/// Storage: `System::Account` (r:2 w:2)
279
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
280
	/// Storage: `Balances::Holds` (r:1 w:1)
281
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
282
	fn accept_requested_change() -> Weight {
283
		// Proof Size summary in bytes:
284
		//  Measured:  `618`
285
		//  Estimated: `6196`
286
		// Minimum execution time: 90_231_000 picoseconds.
287
		Weight::from_parts(138_090_000, 6196)
288
			.saturating_add(RocksDbWeight::get().reads(4_u64))
289
			.saturating_add(RocksDbWeight::get().writes(4_u64))
290
	}
291
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
292
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
293
	fn cancel_change_request() -> Weight {
294
		// Proof Size summary in bytes:
295
		//  Measured:  `286`
296
		//  Estimated: `3751`
297
		// Minimum execution time: 9_140_000 picoseconds.
298
		Weight::from_parts(13_298_000, 3751)
299
			.saturating_add(RocksDbWeight::get().reads(1_u64))
300
			.saturating_add(RocksDbWeight::get().writes(1_u64))
301
	}
302
	/// Storage: `StreamPayment::Streams` (r:1 w:1)
303
	/// Proof: `StreamPayment::Streams` (`max_values`: None, `max_size`: None, mode: `Measured`)
304
	/// Storage: `System::Account` (r:2 w:2)
305
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
306
	/// Storage: `Balances::Holds` (r:1 w:1)
307
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
308
	fn immediately_change_deposit() -> Weight {
309
		// Proof Size summary in bytes:
310
		//  Measured:  `580`
311
		//  Estimated: `6196`
312
		// Minimum execution time: 84_809_000 picoseconds.
313
		Weight::from_parts(104_948_000, 6196)
314
			.saturating_add(RocksDbWeight::get().reads(4_u64))
315
			.saturating_add(RocksDbWeight::get().writes(4_u64))
316
	}
317
}