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 43.0.0
20
//! DATE: 2025-02-04, 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: None, DB CACHE: 1024
24

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

            
41
#![cfg_attr(rustfmt, rustfmt_skip)]
42
#![allow(unused_parens)]
43
#![allow(unused_imports)]
44

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

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