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			fn claim_unpaid_reward() -> Weight;
46		}
47
48		#[cfg(feature = "std")]
49		impl WeightInfo for () {
50			fn bail() -> Weight {
51				Default::default()
52			}
53			fn clear_old_round_data(_p: u32) -> Weight {
54				Default::default()
55			}
56			fn register_eject() -> Weight {
57				Default::default()
58			}
59			fn register_not_full() -> Weight {
60				Default::default()
61			}
62			fn submit_page() -> Weight {
63				Default::default()
64			}
65			fn unset_page() -> Weight {
66				Default::default()
67			}
68			fn claim_unpaid_reward() -> Weight {
69				Default::default()
70			}
71		}
72	}
73
74	pub mod pallet_election_provider_multi_block_unsigned {
75		use super::*;
76
77		/// Weight functions needed for `pallet_election_provider_multi_block::unsigned`.
78		pub trait WeightInfo {
79			fn authorize_submit_unsigned() -> Weight;
80			fn submit_unsigned() -> Weight;
81			// This has an auto-impl as the associated benchmark is `#[extra]`.
82			fn mine_solution(_p: u32) -> Weight {
83				Default::default()
84			}
85		}
86
87		#[cfg(feature = "std")]
88		impl WeightInfo for () {
89			fn authorize_submit_unsigned() -> Weight {
90				Default::default()
91			}
92			fn submit_unsigned() -> Weight {
93				Default::default()
94			}
95		}
96	}
97
98	pub mod pallet_election_provider_multi_block_verifier {
99		use super::*;
100
101		/// Weight functions needed for `pallet_election_provider_multi_block_verifier`.
102		pub trait WeightInfo {
103			fn verification_valid_non_terminal() -> Weight;
104			fn verification_valid_terminal() -> Weight;
105			fn verification_invalid_terminal() -> Weight;
106			fn verification_invalid_non_terminal(v: u32) -> Weight;
107		}
108
109		#[cfg(feature = "std")]
110		impl WeightInfo for () {
111			fn verification_valid_non_terminal() -> Weight {
112				Weight::from_parts(0, 7)
113			}
114			fn verification_valid_terminal() -> Weight {
115				Weight::from_parts(0, 7)
116			}
117			fn verification_invalid_terminal() -> Weight {
118				Weight::from_parts(0, 7)
119			}
120			fn verification_invalid_non_terminal(_v: u32) -> Weight {
121				Weight::from_parts(0, 7)
122			}
123		}
124	}
125
126	pub mod pallet_election_provider_multi_block {
127		use super::*;
128
129		/// Weight functions needed for `pallet_election_provider_multi_block`.
130		pub trait WeightInfo {
131			fn per_block_nothing() -> Weight;
132			fn per_block_snapshot_msp() -> Weight;
133			fn per_block_snapshot_rest() -> Weight;
134			fn per_block_start_signed_validation() -> Weight;
135			fn export_non_terminal() -> Weight;
136			fn export_terminal() -> Weight;
137			fn admin_set() -> Weight;
138			fn manage_fallback() -> Weight;
139		}
140
141		#[cfg(feature = "std")]
142		impl WeightInfo for () {
143			fn per_block_nothing() -> Weight {
144				Default::default()
145			}
146			fn per_block_snapshot_msp() -> Weight {
147				Weight::from_parts(0, 5)
148			}
149			fn per_block_snapshot_rest() -> Weight {
150				Weight::from_parts(0, 5)
151			}
152			fn per_block_start_signed_validation() -> Weight {
153				Weight::from_parts(0, 3)
154			}
155			fn export_non_terminal() -> Weight {
156				Default::default()
157			}
158			fn export_terminal() -> Weight {
159				Default::default()
160			}
161			fn admin_set() -> Weight {
162				Default::default()
163			}
164			fn manage_fallback() -> Weight {
165				Default::default()
166			}
167		}
168	}
169}
170
171/// Kusama-esque weights only be used in testing runtimes.
172pub mod kusama {
173	pub use super::{
174		pallet_election_provider_multi_block_ksm_size::WeightInfo as MultiBlockWeightInfo,
175		pallet_election_provider_multi_block_signed_ksm_size::WeightInfo as MultiBlockSignedWeightInfo,
176		pallet_election_provider_multi_block_unsigned_ksm_size::WeightInfo as MultiBlockUnsignedWeightInfo,
177		pallet_election_provider_multi_block_verifier_ksm_size::WeightInfo as MultiBlockVerifierWeightInfo,
178	};
179}
180
181/// Polkadot-esque weights only be used in testing runtimes.
182pub mod polkadot {
183	pub use super::{
184		pallet_election_provider_multi_block_dot_size::WeightInfo as MultiBlockWeightInfo,
185		pallet_election_provider_multi_block_signed_dot_size::WeightInfo as MultiBlockSignedWeightInfo,
186		pallet_election_provider_multi_block_unsigned_dot_size::WeightInfo as MultiBlockUnsignedWeightInfo,
187		pallet_election_provider_multi_block_verifier_dot_size::WeightInfo as MultiBlockVerifierWeightInfo,
188	};
189}