pallet_crowdloan_rewards/
weights.rs

1// Copyright 2019-2022 PureStake Inc.
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_crowdloan_rewards
18//!
19//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
20//! DATE: 2021-08-01, STEPS: `[32, ]`, REPEAT: 64, LOW RANGE: `[]`, HIGH RANGE: `[]`
21//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128
22
23// Executed Command:
24// ./target/release/moonbeam
25// benchmark
26// --chain
27// dev
28// --execution=wasm
29// --wasm-execution=compiled
30// --pallet
31// pallet_crowdloan_rewards
32// --extrinsic
33// *
34// --steps
35// 32
36// --repeat
37// 64
38// --raw
39// --template=./benchmarking/frame-weight-template.hbs
40// --output
41// /tmp/
42
43#![allow(unused_parens)]
44#![allow(unused_imports)]
45
46use frame_support::{
47	traits::Get,
48	weights::{constants::RocksDbWeight, Weight},
49};
50use sp_std::marker::PhantomData;
51
52/// Weight functions needed for pallet_crowdloan_rewards.
53pub trait WeightInfo {
54	fn claim() -> Weight;
55	fn update_reward_address() -> Weight;
56	fn associate_native_identity() -> Weight;
57	fn change_association_with_relay_keys(x: u32) -> Weight;
58}
59
60/// Weights for pallet_crowdloan_rewards using the Substrate node and recommended hardware.
61pub struct SubstrateWeight<T>(PhantomData<T>);
62impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
63	fn claim() -> Weight {
64		Weight::from_all(101_484_000)
65			.saturating_add(T::DbWeight::get().reads(11))
66			.saturating_add(T::DbWeight::get().writes(5))
67	}
68	fn update_reward_address() -> Weight {
69		Weight::from_all(59_051_000)
70			.saturating_add(T::DbWeight::get().reads(6))
71			.saturating_add(T::DbWeight::get().writes(4))
72	}
73	fn associate_native_identity() -> Weight {
74		Weight::from_all(152_997_000)
75			.saturating_add(T::DbWeight::get().reads(9))
76			.saturating_add(T::DbWeight::get().writes(7))
77	}
78	fn change_association_with_relay_keys(x: u32) -> Weight {
79		Weight::from_all(0)
80			// Standard Error: 7_000
81			.saturating_add(Weight::from_all(47_373_000_u64.saturating_mul(x as u64)))
82			.saturating_add(T::DbWeight::get().reads(6))
83			.saturating_add(T::DbWeight::get().writes(4))
84	}
85}
86
87// For backwards compatibility and tests
88impl WeightInfo for () {
89	fn claim() -> Weight {
90		Weight::from_all(101_484_000)
91			.saturating_add(RocksDbWeight::get().reads(11))
92			.saturating_add(RocksDbWeight::get().writes(5))
93	}
94	fn update_reward_address() -> Weight {
95		Weight::from_all(59_051_000)
96			.saturating_add(RocksDbWeight::get().reads(6))
97			.saturating_add(RocksDbWeight::get().writes(4))
98	}
99	fn associate_native_identity() -> Weight {
100		Weight::from_all(152_997_000)
101			.saturating_add(RocksDbWeight::get().reads(9))
102			.saturating_add(RocksDbWeight::get().writes(7))
103	}
104	fn change_association_with_relay_keys(x: u32) -> Weight {
105		Weight::from_all(0)
106			// Standard Error: 7_000
107			.saturating_add(Weight::from_all(47_373_000_u64.saturating_mul(x as u64)))
108			.saturating_add(RocksDbWeight::get().reads(6))
109			.saturating_add(RocksDbWeight::get().writes(4))
110	}
111}