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_conviction_voting
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0
21
//! DATE: 2024-09-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("starlight-dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// target/release/tanssi-relay
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_conviction_voting
34
// --extrinsic
35
// *
36
// --chain=starlight-dev
37
// --steps
38
// 50
39
// --repeat
40
// 20
41
// --template=benchmarking/frame-weight-runtime-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/starlight_weights/pallet_conviction_voting.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
/// Weights for pallet_conviction_voting using the Substrate node and recommended hardware.
55
pub struct SubstrateWeight<T>(PhantomData<T>);
56
impl<T: frame_system::Config> pallet_conviction_voting::WeightInfo for SubstrateWeight<T> {
57
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
58
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
59
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
60
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
61
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
62
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
63
	/// Storage: `Balances::Locks` (r:1 w:1)
64
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
65
	/// Storage: `Balances::Freezes` (r:1 w:0)
66
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
67
	/// Storage: `Scheduler::Agenda` (r:1 w:1)
68
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
69
	fn vote_new() -> Weight {
70
		// Proof Size summary in bytes:
71
		//  Measured:  `13370`
72
		//  Estimated: `42428`
73
		// Minimum execution time: 167_191_000 picoseconds.
74
		Weight::from_parts(173_228_000, 42428)
75
			.saturating_add(T::DbWeight::get().reads(6_u64))
76
			.saturating_add(T::DbWeight::get().writes(5_u64))
77
	}
78
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
79
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
80
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
81
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
82
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
83
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
84
	/// Storage: `Balances::Locks` (r:1 w:1)
85
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
86
	/// Storage: `Balances::Freezes` (r:1 w:0)
87
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
88
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
89
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
90
	/// Storage: `Scheduler::Retries` (r:0 w:1)
91
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
92
	fn vote_existing() -> Weight {
93
		// Proof Size summary in bytes:
94
		//  Measured:  `14091`
95
		//  Estimated: `83866`
96
		// Minimum execution time: 214_147_000 picoseconds.
97
		Weight::from_parts(221_660_000, 83866)
98
			.saturating_add(T::DbWeight::get().reads(7_u64))
99
			.saturating_add(T::DbWeight::get().writes(7_u64))
100
	}
101
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
102
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
103
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
104
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
105
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
106
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
107
	/// Storage: `Scheduler::Retries` (r:0 w:1)
108
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
109
	fn remove_vote() -> Weight {
110
		// Proof Size summary in bytes:
111
		//  Measured:  `13881`
112
		//  Estimated: `83866`
113
		// Minimum execution time: 173_217_000 picoseconds.
114
		Weight::from_parts(179_496_000, 83866)
115
			.saturating_add(T::DbWeight::get().reads(4_u64))
116
			.saturating_add(T::DbWeight::get().writes(5_u64))
117
	}
118
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
119
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
120
	/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
121
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
122
	fn remove_other_vote() -> Weight {
123
		// Proof Size summary in bytes:
124
		//  Measured:  `13005`
125
		//  Estimated: `30706`
126
		// Minimum execution time: 96_010_000 picoseconds.
127
		Weight::from_parts(100_358_000, 30706)
128
			.saturating_add(T::DbWeight::get().reads(2_u64))
129
			.saturating_add(T::DbWeight::get().writes(1_u64))
130
	}
131
	/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
132
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
133
	/// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512)
134
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
135
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
136
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
137
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
138
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
139
	/// Storage: `Balances::Locks` (r:1 w:1)
140
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
141
	/// Storage: `Balances::Freezes` (r:1 w:0)
142
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
143
	/// Storage: `Scheduler::Retries` (r:0 w:50)
144
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
145
	/// The range of component `r` is `[0, 512]`.
146
	fn delegate(r: u32, ) -> Weight {
147
		// Proof Size summary in bytes:
148
		//  Measured:  `29565 + r * (365 ±0)`
149
		//  Estimated: `83866 + r * (3411 ±0)`
150
		// Minimum execution time: 92_492_000 picoseconds.
151
		Weight::from_parts(1_112_408_114, 83866)
152
			// Standard Error: 80_414
153
			.saturating_add(Weight::from_parts(26_346_340, 0).saturating_mul(r.into()))
154
			.saturating_add(T::DbWeight::get().reads(7_u64))
155
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
156
			.saturating_add(T::DbWeight::get().writes(45_u64))
157
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
158
			.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
159
	}
160
	/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
161
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
162
	/// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512)
163
	/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
164
	/// Storage: `Scheduler::Agenda` (r:2 w:2)
165
	/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
166
	/// Storage: `Scheduler::Retries` (r:0 w:50)
167
	/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
168
	/// The range of component `r` is `[0, 512]`.
169
	fn undelegate(r: u32, ) -> Weight {
170
		// Proof Size summary in bytes:
171
		//  Measured:  `29518 + r * (365 ±0)`
172
		//  Estimated: `83866 + r * (3411 ±0)`
173
		// Minimum execution time: 54_327_000 picoseconds.
174
		Weight::from_parts(1_067_302_070, 83866)
175
			// Standard Error: 80_902
176
			.saturating_add(Weight::from_parts(26_094_083, 0).saturating_mul(r.into()))
177
			.saturating_add(T::DbWeight::get().reads(4_u64))
178
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
179
			.saturating_add(T::DbWeight::get().writes(43_u64))
180
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
181
			.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
182
	}
183
	/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
184
	/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
185
	/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
186
	/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
187
	/// Storage: `Balances::Locks` (r:1 w:1)
188
	/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
189
	/// Storage: `Balances::Freezes` (r:1 w:0)
190
	/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
191
	fn unlock() -> Weight {
192
		// Proof Size summary in bytes:
193
		//  Measured:  `12180`
194
		//  Estimated: `30706`
195
		// Minimum execution time: 126_800_000 picoseconds.
196
		Weight::from_parts(133_974_000, 30706)
197
			.saturating_add(T::DbWeight::get().reads(4_u64))
198
			.saturating_add(T::DbWeight::get().writes(3_u64))
199
	}
200
}