1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//! Autogenerated weights for virto_payment
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-03-19, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// target/release/virto-parachain
// benchmark
// --chain
// dev
// --execution=wasm
// --wasm-execution
// compiled
// --extrinsic=*
// --pallet=virto-payment
// --steps=20
// --repeat=10
// --heap-pages=4096
// --output
// ./pallets/payment/src/weights.rs
// --template
// ./.maintain/frame-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(clippy::unnecessary_cast)]

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

/// Weight functions needed for virto_payment.
pub trait WeightInfo {
	fn pay(x: u32, ) -> Weight;
	fn release() -> Weight;
	fn cancel() -> Weight;
	fn resolve_payment() -> Weight;
	fn request_refund() -> Weight;
	fn dispute_refund() -> Weight;
	fn request_payment() -> Weight;
	fn accept_and_pay() -> Weight;
	fn remove_task() -> Weight;
}

/// Weights for virto_payment using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Sudo Key (r:1 w:0)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:1)
	fn pay(_x: u32, ) -> Weight {
		Weight::from_ref_time(55_900_000)
			.saturating_add(T::DbWeight::get().reads(5 as u64))
			.saturating_add(T::DbWeight::get().writes(4 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	fn release() -> Weight {
		Weight::from_ref_time(36_000_000)
			.saturating_add(T::DbWeight::get().reads(3 as u64))
			.saturating_add(T::DbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:0)
	fn cancel() -> Weight {
		Weight::from_ref_time(48_000_000)
			.saturating_add(T::DbWeight::get().reads(4 as u64))
			.saturating_add(T::DbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	fn resolve_payment() -> Weight {
		Weight::from_ref_time(35_000_000)
			.saturating_add(T::DbWeight::get().reads(3 as u64))
			.saturating_add(T::DbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn request_refund() -> Weight {
		Weight::from_ref_time(20_000_000)
			.saturating_add(T::DbWeight::get().reads(2 as u64))
			.saturating_add(T::DbWeight::get().writes(2 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn dispute_refund() -> Weight {
		Weight::from_ref_time(21_000_000)
			.saturating_add(T::DbWeight::get().reads(2 as u64))
			.saturating_add(T::DbWeight::get().writes(2 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Sudo Key (r:1 w:0)
	fn request_payment() -> Weight {
		Weight::from_ref_time(17_000_000)
			.saturating_add(T::DbWeight::get().reads(2 as u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:1)
	fn accept_and_pay() -> Weight {
		Weight::from_ref_time(58_000_000)
			.saturating_add(T::DbWeight::get().reads(4 as u64))
			.saturating_add(T::DbWeight::get().writes(4 as u64))
	}
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn remove_task() -> Weight {
		Weight::from_ref_time(4_000_000)
			.saturating_add(T::DbWeight::get().reads(1_u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
}

// For backwards compatibility and tests
impl WeightInfo for () {
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Sudo Key (r:1 w:0)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:1)
	fn pay(_x: u32, ) -> Weight {
		Weight::from_ref_time(55_900_000)
			.saturating_add(RocksDbWeight::get().reads(5 as u64))
			.saturating_add(RocksDbWeight::get().writes(4 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	fn release() -> Weight {
		Weight::from_ref_time(36_000_000)
			.saturating_add(RocksDbWeight::get().reads(3 as u64))
			.saturating_add(RocksDbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:0)
	fn cancel() -> Weight {
		Weight::from_ref_time(48_000_000)
			.saturating_add(RocksDbWeight::get().reads(4 as u64))
			.saturating_add(RocksDbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	fn resolve_payment() -> Weight {
		Weight::from_ref_time(35_000_000)
			.saturating_add(RocksDbWeight::get().reads(3 as u64))
			.saturating_add(RocksDbWeight::get().writes(3 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn request_refund() -> Weight {
		Weight::from_ref_time(20_000_000)
			.saturating_add(RocksDbWeight::get().reads(2 as u64))
			.saturating_add(RocksDbWeight::get().writes(2 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn dispute_refund() -> Weight {
		Weight::from_ref_time(21_000_000)
			.saturating_add(RocksDbWeight::get().reads(2 as u64))
			.saturating_add(RocksDbWeight::get().writes(2 as u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Sudo Key (r:1 w:0)
	fn request_payment() -> Weight {
		Weight::from_ref_time(17_000_000)
			.saturating_add(RocksDbWeight::get().reads(2 as u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	// Storage: Payment Payment (r:1 w:1)
	// Storage: Assets Accounts (r:2 w:2)
	// Storage: System Account (r:1 w:1)
	fn accept_and_pay() -> Weight {
		Weight::from_ref_time(58_000_000)
			.saturating_add(RocksDbWeight::get().reads(4 as u64))
			.saturating_add(RocksDbWeight::get().writes(4 as u64))
	}
	// Storage: Payment ScheduledTasks (r:1 w:1)
	fn remove_task() -> Weight {
		Weight::from_ref_time(4_000_000)
			.saturating_add(RocksDbWeight::get().reads(1_u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
}