-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17225f8
commit ec764df
Showing
6 changed files
with
467 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,274 @@ | ||
// This file is part of HydraDX. | ||
|
||
// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Autogenerated weights for pallet_staking | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2023-07-18, STEPS: 10, REPEAT: 30, LOW RANGE: [], HIGH RANGE: [] | ||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 | ||
|
||
// Executed Command: | ||
// target/release/hydradx | ||
// benchmark | ||
// pallet | ||
// --chain=dev | ||
// --steps=10 | ||
// --repeat=30 | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --heap-pages=4096 | ||
// --template=.maintain/pallet-weight-template-no-back.hbs | ||
// --pallet=pallet_staking | ||
// --output=staking.rs | ||
// --extrinsic=* | ||
|
||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
#![allow(clippy::unnecessary_cast)] | ||
|
||
use frame_support::{ | ||
traits::Get, | ||
weights::{constants::RocksDbWeight, Weight}, | ||
}; | ||
use sp_std::marker::PhantomData; | ||
|
||
pub trait WeightInfo {} | ||
/// Weight functions needed for pallet_staking. | ||
pub trait WeightInfo { | ||
fn initialize_staking() -> Weight; | ||
fn stake() -> Weight; | ||
fn increase_stake() -> Weight; | ||
fn claim() -> Weight; | ||
fn unstake() -> Weight; | ||
} | ||
|
||
/// Weights for pallet_staking using the hydraDX node and recommended hardware. | ||
pub struct HydraWeight<T>(PhantomData<T>); | ||
|
||
pub struct SubstrateWeight<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {} | ||
impl<T: frame_system::Config> WeightInfo for HydraWeight<T> { | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: System Account (r:1 w:0) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Uniques ClassAccount (r:0 w:1) | ||
// Proof: Uniques ClassAccount (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) | ||
fn initialize_staking() -> Weight { | ||
// Minimum execution time: 45_493 nanoseconds. | ||
Weight::from_ref_time(46_285_000 as u64) | ||
.saturating_add(T::DbWeight::get().reads(3 as u64)) | ||
.saturating_add(T::DbWeight::get().writes(3 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Account (r:1 w:1) | ||
// Proof: Uniques Account (max_values: None, max_size: Some(112), added: 2587, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:1) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Staking NextPositionId (r:1 w:1) | ||
// Proof: Staking NextPositionId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:1) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Uniques CollectionMaxSupply (r:1 w:0) | ||
// Proof: Uniques CollectionMaxSupply (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:0 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
fn stake() -> Weight { | ||
// Minimum execution time: 93_365 nanoseconds. | ||
Weight::from_ref_time(94_660_000 as u64) | ||
.saturating_add(T::DbWeight::get().reads(9 as u64)) | ||
.saturating_add(T::DbWeight::get().writes(8 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:0) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:1) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
fn increase_stake() -> Weight { | ||
// Minimum execution time: 206_722 nanoseconds. | ||
Weight::from_ref_time(209_665_000 as u64) | ||
.saturating_add(T::DbWeight::get().reads(107 as u64)) | ||
.saturating_add(T::DbWeight::get().writes(4 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:0) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:2) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
fn claim() -> Weight { | ||
// Minimum execution time: 225_912 nanoseconds. | ||
Weight::from_ref_time(227_912_000 as u64) | ||
.saturating_add(T::DbWeight::get().reads(107 as u64)) | ||
.saturating_add(T::DbWeight::get().writes(5 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:1) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:2) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Uniques Account (r:0 w:1) | ||
// Proof: Uniques Account (max_values: None, max_size: Some(112), added: 2587, mode: MaxEncodedLen) | ||
// Storage: Uniques ItemPriceOf (r:0 w:1) | ||
// Proof: Uniques ItemPriceOf (max_values: None, max_size: Some(113), added: 2588, mode: MaxEncodedLen) | ||
fn unstake() -> Weight { | ||
// Minimum execution time: 246_989 nanoseconds. | ||
Weight::from_ref_time(249_570_000 as u64) | ||
.saturating_add(T::DbWeight::get().reads(108 as u64)) | ||
.saturating_add(T::DbWeight::get().writes(9 as u64)) | ||
} | ||
} | ||
|
||
impl WeightInfo for () {} | ||
// For backwards compatibility and tests | ||
impl WeightInfo for () { | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: System Account (r:1 w:0) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Uniques ClassAccount (r:0 w:1) | ||
// Proof: Uniques ClassAccount (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) | ||
fn initialize_staking() -> Weight { | ||
// Minimum execution time: 45_493 nanoseconds. | ||
Weight::from_ref_time(46_285_000 as u64) | ||
.saturating_add(RocksDbWeight::get().reads(3 as u64)) | ||
.saturating_add(RocksDbWeight::get().writes(3 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Account (r:1 w:1) | ||
// Proof: Uniques Account (max_values: None, max_size: Some(112), added: 2587, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:1) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Staking NextPositionId (r:1 w:1) | ||
// Proof: Staking NextPositionId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:1) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Uniques CollectionMaxSupply (r:1 w:0) | ||
// Proof: Uniques CollectionMaxSupply (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:0 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
fn stake() -> Weight { | ||
// Minimum execution time: 93_365 nanoseconds. | ||
Weight::from_ref_time(94_660_000 as u64) | ||
.saturating_add(RocksDbWeight::get().reads(9 as u64)) | ||
.saturating_add(RocksDbWeight::get().writes(8 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:0) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:1) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
fn increase_stake() -> Weight { | ||
// Minimum execution time: 206_722 nanoseconds. | ||
Weight::from_ref_time(209_665_000 as u64) | ||
.saturating_add(RocksDbWeight::get().reads(107 as u64)) | ||
.saturating_add(RocksDbWeight::get().writes(4 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:0) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:2) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
fn claim() -> Weight { | ||
// Minimum execution time: 225_912 nanoseconds. | ||
Weight::from_ref_time(227_912_000 as u64) | ||
.saturating_add(RocksDbWeight::get().reads(107 as u64)) | ||
.saturating_add(RocksDbWeight::get().writes(5 as u64)) | ||
} | ||
// Storage: Staking Staking (r:1 w:1) | ||
// Proof: Staking Staking (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) | ||
// Storage: Uniques Asset (r:1 w:1) | ||
// Proof: Uniques Asset (max_values: None, max_size: Some(146), added: 2621, mode: MaxEncodedLen) | ||
// Storage: System Account (r:2 w:2) | ||
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) | ||
// Storage: Staking Positions (r:1 w:1) | ||
// Proof: Staking Positions (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) | ||
// Storage: Staking PositionVotes (r:1 w:0) | ||
// Proof: Staking PositionVotes (max_values: None, max_size: Some(2134), added: 4609, mode: MaxEncodedLen) | ||
// Storage: Democracy ReferendumInfoOf (r:100 w:0) | ||
// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) | ||
// Storage: Uniques Class (r:1 w:1) | ||
// Proof: Uniques Class (max_values: None, max_size: Some(190), added: 2665, mode: MaxEncodedLen) | ||
// Storage: Balances Locks (r:1 w:1) | ||
// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) | ||
// Storage: Uniques Account (r:0 w:1) | ||
// Proof: Uniques Account (max_values: None, max_size: Some(112), added: 2587, mode: MaxEncodedLen) | ||
// Storage: Uniques ItemPriceOf (r:0 w:1) | ||
// Proof: Uniques ItemPriceOf (max_values: None, max_size: Some(113), added: 2588, mode: MaxEncodedLen) | ||
fn unstake() -> Weight { | ||
// Minimum execution time: 246_989 nanoseconds. | ||
Weight::from_ref_time(249_570_000 as u64) | ||
.saturating_add(RocksDbWeight::get().reads(108 as u64)) | ||
.saturating_add(RocksDbWeight::get().writes(9 as u64)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.