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
186
187
188
189
190
191
192
193
194
195
196
197
198
199

//! Autogenerated weights for oracle
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-04-04, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `sander-dell`, CPU: `11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024

// Executed Command:
// target/release/interbtc-parachain
// benchmark
// pallet
// --pallet
// oracle
// --extrinsic
// *
// --chain
// kintsugi-dev
// --execution=wasm
// --wasm-execution=compiled
// --steps
// 100
// --repeat
// 10
// --output
// oracle_default_weights.rs
// --template
// .deploy/weight-template.hbs

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

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

/// Weight functions needed for oracle.
pub trait WeightInfo {
	fn on_initialize(u: u32, ) -> Weight;
	fn feed_values(u: u32, ) -> Weight;
	fn insert_authorized_oracle() -> Weight;
	fn remove_authorized_oracle() -> Weight;
}

/// Weights for oracle using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	/// Storage: Oracle RawValuesUpdated (r:1001 w:1000)
	/// Proof Skipped: Oracle RawValuesUpdated (max_values: None, max_size: None, mode: Measured)
	/// Storage: Timestamp Now (r:1 w:0)
	/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
	/// Storage: Oracle RawValues (r:2000 w:0)
	/// Proof Skipped: Oracle RawValues (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle MaxDelay (r:1 w:0)
	/// Proof Skipped: Oracle MaxDelay (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: VaultRewards TotalStake (r:1000 w:0)
	/// Proof Skipped: VaultRewards TotalStake (max_values: None, max_size: None, mode: Measured)
	/// Storage: Security ParachainStatus (r:1 w:1)
	/// Proof Skipped: Security ParachainStatus (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: Security Errors (r:1 w:1)
	/// Proof Skipped: Security Errors (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: Oracle Aggregate (r:0 w:1000)
	/// Proof Skipped: Oracle Aggregate (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle ValidUntil (r:0 w:1000)
	/// Proof Skipped: Oracle ValidUntil (max_values: None, max_size: None, mode: Measured)
	/// The range of component `u` is `[1, 1000]`.
	fn on_initialize(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1536 + u * (127 ±0)`
		//  Estimated: `16631 + u * (10916 ±0)`
		// Minimum execution time: 63_664_000 picoseconds.
		Weight::from_parts(64_646_000, 16631)
			// Standard Error: 52_342
			.saturating_add(Weight::from_parts(28_651_201, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(5_u64))
			.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into())))
			.saturating_add(T::DbWeight::get().writes(2_u64))
			.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 10916).saturating_mul(u.into()))
	}
	/// Storage: Oracle AuthorizedOracles (r:1 w:0)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	/// Storage: Timestamp Now (r:1 w:0)
	/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
	/// Storage: Oracle RawValuesUpdated (r:0 w:1000)
	/// Proof Skipped: Oracle RawValuesUpdated (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle RawValues (r:0 w:1000)
	/// Proof Skipped: Oracle RawValues (max_values: None, max_size: None, mode: Measured)
	/// The range of component `u` is `[1, 1000]`.
	fn feed_values(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1285`
		//  Estimated: `6833`
		// Minimum execution time: 30_016_000 picoseconds.
		Weight::from_parts(32_422_000, 6833)
			// Standard Error: 9_680
			.saturating_add(Weight::from_parts(4_404_463, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(2_u64))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into())))
	}
	/// Storage: Oracle AuthorizedOracles (r:0 w:1)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	fn insert_authorized_oracle() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1021`
		//  Estimated: `1021`
		// Minimum execution time: 20_663_000 picoseconds.
		Weight::from_parts(21_512_000, 1021)
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: Oracle AuthorizedOracles (r:0 w:1)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	fn remove_authorized_oracle() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1021`
		//  Estimated: `1021`
		// Minimum execution time: 20_920_000 picoseconds.
		Weight::from_parts(21_636_000, 1021)
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
}

// For backwards compatibility and tests
impl WeightInfo for () {
	/// Storage: Oracle RawValuesUpdated (r:1001 w:1000)
	/// Proof Skipped: Oracle RawValuesUpdated (max_values: None, max_size: None, mode: Measured)
	/// Storage: Timestamp Now (r:1 w:0)
	/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
	/// Storage: Oracle RawValues (r:2000 w:0)
	/// Proof Skipped: Oracle RawValues (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle MaxDelay (r:1 w:0)
	/// Proof Skipped: Oracle MaxDelay (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: VaultRewards TotalStake (r:1000 w:0)
	/// Proof Skipped: VaultRewards TotalStake (max_values: None, max_size: None, mode: Measured)
	/// Storage: Security ParachainStatus (r:1 w:1)
	/// Proof Skipped: Security ParachainStatus (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: Security Errors (r:1 w:1)
	/// Proof Skipped: Security Errors (max_values: Some(1), max_size: None, mode: Measured)
	/// Storage: Oracle Aggregate (r:0 w:1000)
	/// Proof Skipped: Oracle Aggregate (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle ValidUntil (r:0 w:1000)
	/// Proof Skipped: Oracle ValidUntil (max_values: None, max_size: None, mode: Measured)
	/// The range of component `u` is `[1, 1000]`.
	fn on_initialize(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1536 + u * (127 ±0)`
		//  Estimated: `16631 + u * (10916 ±0)`
		// Minimum execution time: 63_664_000 picoseconds.
		Weight::from_parts(64_646_000, 16631)
			// Standard Error: 52_342
			.saturating_add(Weight::from_parts(28_651_201, 0).saturating_mul(u.into()))
			.saturating_add(RocksDbWeight::get().reads(5_u64))
			.saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(u.into())))
			.saturating_add(RocksDbWeight::get().writes(2_u64))
			.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 10916).saturating_mul(u.into()))
	}
	/// Storage: Oracle AuthorizedOracles (r:1 w:0)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	/// Storage: Timestamp Now (r:1 w:0)
	/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
	/// Storage: Oracle RawValuesUpdated (r:0 w:1000)
	/// Proof Skipped: Oracle RawValuesUpdated (max_values: None, max_size: None, mode: Measured)
	/// Storage: Oracle RawValues (r:0 w:1000)
	/// Proof Skipped: Oracle RawValues (max_values: None, max_size: None, mode: Measured)
	/// The range of component `u` is `[1, 1000]`.
	fn feed_values(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1285`
		//  Estimated: `6833`
		// Minimum execution time: 30_016_000 picoseconds.
		Weight::from_parts(32_422_000, 6833)
			// Standard Error: 9_680
			.saturating_add(Weight::from_parts(4_404_463, 0).saturating_mul(u.into()))
			.saturating_add(RocksDbWeight::get().reads(2_u64))
			.saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(u.into())))
	}
	/// Storage: Oracle AuthorizedOracles (r:0 w:1)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	fn insert_authorized_oracle() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1021`
		//  Estimated: `1021`
		// Minimum execution time: 20_663_000 picoseconds.
		Weight::from_parts(21_512_000, 1021)
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: Oracle AuthorizedOracles (r:0 w:1)
	/// Proof Skipped: Oracle AuthorizedOracles (max_values: None, max_size: None, mode: Measured)
	fn remove_authorized_oracle() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1021`
		//  Estimated: `1021`
		// Minimum execution time: 20_920_000 picoseconds.
		Weight::from_parts(21_636_000, 1021)
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
}