pallet_staking_async_points_converter/weights.rs
1// Copyright (C) Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Default weights for `pallet_staking_async_points_converter`, from the Asset Hub Westend
17//! runtime benchmark.
18//!
19//! Runtimes should use their own benchmarked weights.
20
21#![allow(unused_parens)]
22#![allow(unused_imports)]
23
24use core::marker::PhantomData;
25use frame_support::{
26 traits::Get,
27 weights::{constants::RocksDbWeight, Weight},
28};
29
30/// Weight functions needed for `pallet_staking_async_points_converter`.
31pub trait WeightInfo {
32 fn set_points_per_service() -> Weight;
33 fn report_authored_blocks() -> Weight;
34}
35
36/// Default weights for `pallet_staking_async_points_converter`, see the module doc for their
37/// source.
38pub struct SubstrateWeight<T>(PhantomData<T>);
39impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
40 /// Storage: `StakingPointsConverter::PointsPerService` (r:0 w:1)
41 /// Proof: `StakingPointsConverter::PointsPerService` (`max_values`: None, `max_size`: Some(25),
42 /// added: 2500, mode: `MaxEncodedLen`)
43 fn set_points_per_service() -> Weight {
44 Weight::from_parts(3_948_000, 0).saturating_add(T::DbWeight::get().writes(1_u64))
45 }
46 /// Storage: `StakingPointsConverter::PointsPerService` (r:1 w:0)
47 /// Proof: `StakingPointsConverter::PointsPerService` (`max_values`: None, `max_size`: Some(25),
48 /// added: 2500, mode: `MaxEncodedLen`)
49 fn report_authored_blocks() -> Weight {
50 Weight::from_parts(6_923_000, 3_490).saturating_add(T::DbWeight::get().reads(1_u64))
51 }
52}
53
54// For backwards compatibility and tests.
55impl WeightInfo for () {
56 /// Storage: `StakingPointsConverter::PointsPerService` (r:0 w:1)
57 /// Proof: `StakingPointsConverter::PointsPerService` (`max_values`: None, `max_size`: Some(25),
58 /// added: 2500, mode: `MaxEncodedLen`)
59 fn set_points_per_service() -> Weight {
60 Weight::from_parts(3_948_000, 0).saturating_add(RocksDbWeight::get().writes(1_u64))
61 }
62 /// Storage: `StakingPointsConverter::PointsPerService` (r:1 w:0)
63 /// Proof: `StakingPointsConverter::PointsPerService` (`max_values`: None, `max_size`: Some(25),
64 /// added: 2500, mode: `MaxEncodedLen`)
65 fn report_authored_blocks() -> Weight {
66 Weight::from_parts(6_923_000, 3_490).saturating_add(RocksDbWeight::get().reads(1_u64))
67 }
68}