1
// Copyright 2024 Moonbeam foundation
2
// This file is part of Moonbeam.
3

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

            
17
//! Autogenerated weights for `pallet_conviction_voting`
18
//!
19
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0
20
//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21
//! WORST CASE MAP SIZE: `1000000`
22
//! HOSTNAME: `ip-10-0-0-176`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
23
//! WASM-EXECUTION: Compiled, CHAIN: Some("moonbase-dev"), DB CACHE: 1024
24

            
25
// Executed Command:
26
// ./target/production/moonbeam
27
// benchmark
28
// pallet
29
// --chain=moonbase-dev
30
// --steps=50
31
// --repeat=20
32
// --pallet=pallet_conviction_voting
33
// --extrinsic=*
34
// --wasm-execution=compiled
35
// --header=./file_header.txt
36
// --template=./benchmarking/frame-weight-template.hbs
37
// --output=./runtime/common/src/weights/
38

            
39
#![cfg_attr(rustfmt, rustfmt_skip)]
40
#![allow(unused_parens)]
41
#![allow(unused_imports)]
42

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

            
46
/// Weights for `pallet_conviction_voting`.
47
pub struct WeightInfo<T>(PhantomData<T>);
48
impl<T: frame_system::Config> pallet_conviction_voting::WeightInfo for WeightInfo<T> {
49
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
50
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
51
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
52
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
53
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
54
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(137), added: 2612, mode: `MaxEncodedLen`)
55
	/// Storage: `Balances::Locks` (r:1 w:1)
56
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1287), added: 3762, mode: `MaxEncodedLen`)
57
	/// Storage: `Balances::Freezes` (r:1 w:0)
58
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
59
	/// Storage: `Scheduler::Agenda` (r:1 w:1)
60
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
61
	fn vote_new() -> Weight {
62
		// Proof Size summary in bytes:
63
		//  Measured:  `1962`
64
		//  Estimated: `42428`
65
		// Minimum execution time: 64_184_000 picoseconds.
66
		Weight::from_parts(66_327_000, 42428)
67
			.saturating_add(T::DbWeight::get().reads(6_u64))
68
			.saturating_add(T::DbWeight::get().writes(5_u64))
69
	}
70
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
71
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
72
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
73
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
74
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
75
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(137), added: 2612, mode: `MaxEncodedLen`)
76
	/// Storage: `Balances::Locks` (r:1 w:1)
77
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1287), added: 3762, mode: `MaxEncodedLen`)
78
	/// Storage: `Balances::Freezes` (r:1 w:0)
79
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
80
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
81
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
82
	/// Storage: `Scheduler::Retries` (r:0 w:1)
83
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
84
	fn vote_existing() -> Weight {
85
		// Proof Size summary in bytes:
86
		//  Measured:  `2263`
87
		//  Estimated: `83866`
88
		// Minimum execution time: 85_618_000 picoseconds.
89
		Weight::from_parts(87_791_000, 83866)
90
			.saturating_add(T::DbWeight::get().reads(7_u64))
91
			.saturating_add(T::DbWeight::get().writes(7_u64))
92
	}
93
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
94
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
95
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
96
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
97
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
98
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
99
	/// Storage: `Scheduler::Retries` (r:0 w:1)
100
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
101
	fn remove_vote() -> Weight {
102
		// Proof Size summary in bytes:
103
		//  Measured:  `1841`
104
		//  Estimated: `83866`
105
		// Minimum execution time: 55_538_000 picoseconds.
106
		Weight::from_parts(57_314_000, 83866)
107
			.saturating_add(T::DbWeight::get().reads(4_u64))
108
			.saturating_add(T::DbWeight::get().writes(5_u64))
109
	}
110
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
111
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
112
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
113
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
114
	fn remove_other_vote() -> Weight {
115
		// Proof Size summary in bytes:
116
		//  Measured:  `1385`
117
		//  Estimated: `4617`
118
		// Minimum execution time: 19_849_000 picoseconds.
119
		Weight::from_parts(21_122_000, 4617)
120
			.saturating_add(T::DbWeight::get().reads(2_u64))
121
			.saturating_add(T::DbWeight::get().writes(1_u64))
122
	}
123
	/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
124
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
125
	/// Storage: `Referenda::ReferendumInfoFor` (r:20 w:20)
126
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
127
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
128
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
129
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
130
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(137), added: 2612, mode: `MaxEncodedLen`)
131
	/// Storage: `Balances::Locks` (r:1 w:1)
132
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1287), added: 3762, mode: `MaxEncodedLen`)
133
	/// Storage: `Balances::Freezes` (r:1 w:0)
134
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
135
	/// Storage: `Scheduler::Retries` (r:0 w:20)
136
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
137
	/// The range of component `r` is `[0, 20]`.
138
	fn delegate(r: u32, ) -> Weight {
139
		// Proof Size summary in bytes:
140
		//  Measured:  `1621 + r * (248 ±0)`
141
		//  Estimated: `83866 + r * (3387 ±0)`
142
		// Minimum execution time: 43_863_000 picoseconds.
143
		Weight::from_parts(40_802_182, 83866)
144
			// Standard Error: 75_692
145
			.saturating_add(Weight::from_parts(25_978_125, 0).saturating_mul(r.into()))
146
			.saturating_add(T::DbWeight::get().reads(7_u64))
147
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
148
			.saturating_add(T::DbWeight::get().writes(6_u64))
149
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into())))
150
			.saturating_add(Weight::from_parts(0, 3387).saturating_mul(r.into()))
151
	}
152
	/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
153
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
154
	/// Storage: `Referenda::ReferendumInfoFor` (r:20 w:20)
155
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(912), added: 3387, mode: `MaxEncodedLen`)
156
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
157
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
158
	/// Storage: `Scheduler::Retries` (r:0 w:20)
159
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
160
	/// The range of component `r` is `[0, 20]`.
161
	fn undelegate(r: u32, ) -> Weight {
162
		// Proof Size summary in bytes:
163
		//  Measured:  `1340 + r * (248 ±0)`
164
		//  Estimated: `83866 + r * (3387 ±0)`
165
		// Minimum execution time: 19_070_000 picoseconds.
166
		Weight::from_parts(9_796_559, 83866)
167
			// Standard Error: 85_888
168
			.saturating_add(Weight::from_parts(26_327_253, 0).saturating_mul(r.into()))
169
			.saturating_add(T::DbWeight::get().reads(4_u64))
170
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
171
			.saturating_add(T::DbWeight::get().writes(4_u64))
172
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into())))
173
			.saturating_add(Weight::from_parts(0, 3387).saturating_mul(r.into()))
174
	}
175
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
176
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(1152), added: 3627, mode: `MaxEncodedLen`)
177
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
178
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(137), added: 2612, mode: `MaxEncodedLen`)
179
	/// Storage: `Balances::Locks` (r:1 w:1)
180
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1287), added: 3762, mode: `MaxEncodedLen`)
181
	/// Storage: `Balances::Freezes` (r:1 w:0)
182
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
183
	fn unlock() -> Weight {
184
		// Proof Size summary in bytes:
185
		//  Measured:  `1228`
186
		//  Estimated: `4752`
187
		// Minimum execution time: 48_423_000 picoseconds.
188
		Weight::from_parts(49_553_000, 4752)
189
			.saturating_add(T::DbWeight::get().reads(4_u64))
190
			.saturating_add(T::DbWeight::get().writes(3_u64))
191
	}
192
}