referrerpolicy=no-referrer-when-downgrade

pallet_election_provider_multi_block/weights/
mod.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! WeightInfo for the election provider multi-block pallet group.
19
20mod pallet_election_provider_multi_block_dot_size;
21mod pallet_election_provider_multi_block_signed_dot_size;
22mod pallet_election_provider_multi_block_unsigned_dot_size;
23mod pallet_election_provider_multi_block_verifier_dot_size;
24
25mod pallet_election_provider_multi_block_ksm_size;
26mod pallet_election_provider_multi_block_signed_ksm_size;
27mod pallet_election_provider_multi_block_unsigned_ksm_size;
28mod pallet_election_provider_multi_block_verifier_ksm_size;
29
30use frame_support::pallet_prelude::Weight;
31
32pub mod traits {
33	use super::*;
34	pub mod pallet_election_provider_multi_block_signed {
35		use super::*;
36
37		/// Weight functions needed for `pallet_election_provider_multi_block_signed`.
38		pub trait WeightInfo {
39			fn register_not_full() -> Weight;
40			fn register_eject() -> Weight;
41			fn submit_page() -> Weight;
42			fn unset_page() -> Weight;
43			fn bail() -> Weight;
44			fn clear_old_round_data(p: u32) -> Weight;
45		}
46
47		#[cfg(feature = "std")]
48		impl WeightInfo for () {
49			fn bail() -> Weight {
50				Default::default()
51			}
52			fn clear_old_round_data(_p: u32) -> Weight {
53				Default::default()
54			}
55			fn register_eject() -> Weight {
56				Default::default()
57			}
58			fn register_not_full() -> Weight {
59				Default::default()
60			}
61			fn submit_page() -> Weight {
62				Default::default()
63			}
64			fn unset_page() -> Weight {
65				Default::default()
66			}
67		}
68	}
69
70	pub mod pallet_election_provider_multi_block_unsigned {
71		use super::*;
72
73		/// Weight functions needed for `pallet_election_provider_multi_block::unsigned`.
74		pub trait WeightInfo {
75			fn validate_unsigned() -> Weight;
76			fn submit_unsigned() -> Weight;
77			// This has an auto-impl as the associated benchmark is `#[extra]`.
78			fn mine_solution(_p: u32) -> Weight {
79				Default::default()
80			}
81		}
82
83		#[cfg(feature = "std")]
84		impl WeightInfo for () {
85			fn validate_unsigned() -> Weight {
86				Default::default()
87			}
88			fn submit_unsigned() -> Weight {
89				Default::default()
90			}
91		}
92	}
93
94	pub mod pallet_election_provider_multi_block_verifier {
95		use super::*;
96
97		/// Weight functions needed for `pallet_election_provider_multi_block_verifier`.
98		pub trait WeightInfo {
99			fn verification_valid_non_terminal() -> Weight;
100			fn verification_valid_terminal() -> Weight;
101			fn verification_invalid_terminal() -> Weight;
102			fn verification_invalid_non_terminal(v: u32) -> Weight;
103		}
104
105		#[cfg(feature = "std")]
106		impl WeightInfo for () {
107			fn verification_valid_non_terminal() -> Weight {
108				Weight::from_parts(0, 7)
109			}
110			fn verification_valid_terminal() -> Weight {
111				Weight::from_parts(0, 7)
112			}
113			fn verification_invalid_terminal() -> Weight {
114				Weight::from_parts(0, 7)
115			}
116			fn verification_invalid_non_terminal(_v: u32) -> Weight {
117				Weight::from_parts(0, 7)
118			}
119		}
120	}
121
122	pub mod pallet_election_provider_multi_block {
123		use super::*;
124
125		/// Weight functions needed for `pallet_election_provider_multi_block`.
126		pub trait WeightInfo {
127			fn per_block_nothing() -> Weight;
128			fn per_block_snapshot_msp() -> Weight;
129			fn per_block_snapshot_rest() -> Weight;
130			fn per_block_start_signed_validation() -> Weight;
131			fn export_non_terminal() -> Weight;
132			fn export_terminal() -> Weight;
133			fn admin_set() -> Weight;
134			fn manage_fallback() -> Weight;
135		}
136
137		#[cfg(feature = "std")]
138		impl WeightInfo for () {
139			fn per_block_nothing() -> Weight {
140				Default::default()
141			}
142			fn per_block_snapshot_msp() -> Weight {
143				Weight::from_parts(0, 5)
144			}
145			fn per_block_snapshot_rest() -> Weight {
146				Weight::from_parts(0, 5)
147			}
148			fn per_block_start_signed_validation() -> Weight {
149				Weight::from_parts(0, 3)
150			}
151			fn export_non_terminal() -> Weight {
152				Default::default()
153			}
154			fn export_terminal() -> Weight {
155				Default::default()
156			}
157			fn admin_set() -> Weight {
158				Default::default()
159			}
160			fn manage_fallback() -> Weight {
161				Default::default()
162			}
163		}
164	}
165}
166
167/// Kusama-esque weights only be used in testing runtimes.
168pub mod kusama {
169	pub use super::{
170		pallet_election_provider_multi_block_ksm_size::WeightInfo as MultiBlockWeightInfo,
171		pallet_election_provider_multi_block_signed_ksm_size::WeightInfo as MultiBlockSignedWeightInfo,
172		pallet_election_provider_multi_block_unsigned_ksm_size::WeightInfo as MultiBlockUnsignedWeightInfo,
173		pallet_election_provider_multi_block_verifier_ksm_size::WeightInfo as MultiBlockVerifierWeightInfo,
174	};
175}
176
177/// Polkadot-esque weights only be used in testing runtimes.
178pub mod polkadot {
179	pub use super::{
180		pallet_election_provider_multi_block_dot_size::WeightInfo as MultiBlockWeightInfo,
181		pallet_election_provider_multi_block_signed_dot_size::WeightInfo as MultiBlockSignedWeightInfo,
182		pallet_election_provider_multi_block_unsigned_dot_size::WeightInfo as MultiBlockUnsignedWeightInfo,
183		pallet_election_provider_multi_block_verifier_dot_size::WeightInfo as MultiBlockVerifierWeightInfo,
184	};
185}