mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 10:17:57 +00:00
More Improvements to Benchmarking CLI + Generic WeightInfo (#7168)
* Generic WeightInfo, Output File Path * Make `WeightInfo` generic * Add support for header file * fix line width * add `--spaces` flag * Configurable trait and struct strings * make elections phragmen generic * Add date to generated file * Apply suggestions from code review Co-authored-by: Gavin Wood <gavin@parity.io> * fixes * add settings metadata to output Co-authored-by: nikvolf <nikvolf@gmail.com> Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
Generated
+1
@@ -1532,6 +1532,7 @@ dependencies = [
|
||||
name = "frame-benchmarking-cli"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"frame-benchmarking",
|
||||
"parity-scale-codec",
|
||||
"sc-cli",
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
|
||||
// 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.
|
||||
@@ -183,13 +183,13 @@ impl frame_system::Trait for Runtime {
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = weights::frame_system::WeightInfo;
|
||||
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_utility::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type WeightInfo = weights::pallet_utility::WeightInfo;
|
||||
type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -207,7 +207,7 @@ impl pallet_multisig::Trait for Runtime {
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type WeightInfo = weights::pallet_multisig::WeightInfo;
|
||||
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -271,7 +271,7 @@ impl pallet_proxy::Trait for Runtime {
|
||||
type ProxyDepositBase = ProxyDepositBase;
|
||||
type ProxyDepositFactor = ProxyDepositFactor;
|
||||
type MaxProxies = MaxProxies;
|
||||
type WeightInfo = weights::pallet_proxy::WeightInfo;
|
||||
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
|
||||
type MaxPending = MaxPending;
|
||||
type CallHasher = BlakeTwo256;
|
||||
type AnnouncementDepositBase = AnnouncementDepositBase;
|
||||
@@ -291,7 +291,7 @@ impl pallet_scheduler::Trait for Runtime {
|
||||
type MaximumWeight = MaximumSchedulerWeight;
|
||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
||||
type WeightInfo = weights::pallet_scheduler::WeightInfo;
|
||||
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -331,7 +331,7 @@ impl pallet_indices::Trait for Runtime {
|
||||
type Currency = Balances;
|
||||
type Deposit = IndexDeposit;
|
||||
type Event = Event;
|
||||
type WeightInfo = weights::pallet_indices::WeightInfo;
|
||||
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -348,7 +348,7 @@ impl pallet_balances::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = frame_system::Module<Runtime>;
|
||||
type WeightInfo = weights::pallet_balances::WeightInfo;
|
||||
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -375,7 +375,7 @@ impl pallet_timestamp::Trait for Runtime {
|
||||
type Moment = Moment;
|
||||
type OnTimestampSet = Babe;
|
||||
type MinimumPeriod = MinimumPeriod;
|
||||
type WeightInfo = weights::pallet_timestamp::WeightInfo;
|
||||
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -412,7 +412,7 @@ impl pallet_session::Trait for Runtime {
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type WeightInfo = weights::pallet_session::WeightInfo;
|
||||
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
@@ -469,7 +469,7 @@ impl pallet_staking::Trait for Runtime {
|
||||
type MinSolutionScoreBump = MinSolutionScoreBump;
|
||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||
type UnsignedPriority = StakingUnsignedPriority;
|
||||
type WeightInfo = weights::pallet_staking::WeightInfo;
|
||||
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -518,7 +518,7 @@ impl pallet_democracy::Trait for Runtime {
|
||||
type Scheduler = Scheduler;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type MaxVotes = MaxVotes;
|
||||
type WeightInfo = weights::pallet_democracy::WeightInfo;
|
||||
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -536,7 +536,7 @@ impl pallet_collective::Trait<CouncilCollective> for Runtime {
|
||||
type MaxProposals = CouncilMaxProposals;
|
||||
type MaxMembers = CouncilMaxMembers;
|
||||
type DefaultVote = pallet_collective::PrimeDefaultVote;
|
||||
type WeightInfo = weights::pallet_collective::WeightInfo;
|
||||
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -568,7 +568,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
|
||||
type DesiredMembers = DesiredMembers;
|
||||
type DesiredRunnersUp = DesiredRunnersUp;
|
||||
type TermDuration = TermDuration;
|
||||
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo;
|
||||
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -586,7 +586,7 @@ impl pallet_collective::Trait<TechnicalCollective> for Runtime {
|
||||
type MaxProposals = TechnicalMaxProposals;
|
||||
type MaxMembers = TechnicalMaxMembers;
|
||||
type DefaultVote = pallet_collective::PrimeDefaultVote;
|
||||
type WeightInfo = weights::pallet_collective::WeightInfo;
|
||||
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
type EnsureRootOrHalfCouncil = EnsureOneOf<
|
||||
@@ -654,7 +654,7 @@ impl pallet_treasury::Trait for Runtime {
|
||||
type BountyValueMinimum = BountyValueMinimum;
|
||||
type MaximumReasonLength = MaximumReasonLength;
|
||||
type BurnDestination = ();
|
||||
type WeightInfo = weights::pallet_treasury::WeightInfo;
|
||||
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -759,7 +759,7 @@ impl pallet_im_online::Trait for Runtime {
|
||||
type SessionDuration = SessionDuration;
|
||||
type ReportUnresponsiveness = Offences;
|
||||
type UnsignedPriority = ImOnlineUnsignedPriority;
|
||||
type WeightInfo = weights::pallet_im_online::WeightInfo;
|
||||
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -827,7 +827,7 @@ impl pallet_identity::Trait for Runtime {
|
||||
type Slashed = Treasury;
|
||||
type ForceOrigin = EnsureRootOrHalfCouncil;
|
||||
type RegistrarOrigin = EnsureRootOrHalfCouncil;
|
||||
type WeightInfo = weights::pallet_identity::WeightInfo;
|
||||
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -884,7 +884,7 @@ impl pallet_vesting::Trait for Runtime {
|
||||
type Currency = Balances;
|
||||
type BlockNumberToBalance = ConvertInto;
|
||||
type MinVestedTransfer = MinVestedTransfer;
|
||||
type WeightInfo = weights::pallet_vesting::WeightInfo;
|
||||
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
construct_runtime!(
|
||||
|
||||
@@ -19,38 +19,39 @@
|
||||
|
||||
#![allow(unused_parens)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl frame_system::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> frame_system::WeightInfo for WeightInfo<T> {
|
||||
// WARNING! Some components were not used: ["b"]
|
||||
fn remark() -> Weight {
|
||||
(1305000 as Weight)
|
||||
}
|
||||
fn set_heap_pages() -> Weight {
|
||||
(2023000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// WARNING! Some components were not used: ["d"]
|
||||
fn set_changes_trie_config() -> Weight {
|
||||
(10026000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn set_storage(i: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((656000 as Weight).saturating_mul(i as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
|
||||
}
|
||||
fn kill_storage(i: u32, ) -> Weight {
|
||||
(4327000 as Weight)
|
||||
.saturating_add((478000 as Weight).saturating_mul(i as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
|
||||
}
|
||||
fn kill_prefix(p: u32, ) -> Weight {
|
||||
(8349000 as Weight)
|
||||
.saturating_add((838000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
}
|
||||
fn suicide() -> Weight {
|
||||
(29247000 as Weight)
|
||||
|
||||
@@ -17,18 +17,18 @@
|
||||
|
||||
pub mod frame_system;
|
||||
pub mod pallet_balances;
|
||||
pub mod pallet_treasury;
|
||||
pub mod pallet_collective;
|
||||
pub mod pallet_democracy;
|
||||
pub mod pallet_elections_phragmen;
|
||||
pub mod pallet_identity;
|
||||
pub mod pallet_indices;
|
||||
pub mod pallet_im_online;
|
||||
pub mod pallet_indices;
|
||||
pub mod pallet_multisig;
|
||||
pub mod pallet_proxy;
|
||||
pub mod pallet_scheduler;
|
||||
pub mod pallet_session;
|
||||
pub mod pallet_staking;
|
||||
pub mod pallet_timestamp;
|
||||
pub mod pallet_treasury;
|
||||
pub mod pallet_utility;
|
||||
pub mod pallet_vesting;
|
||||
pub mod pallet_elections_phragmen;
|
||||
|
||||
@@ -15,33 +15,34 @@
|
||||
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_balances::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_balances::WeightInfo for WeightInfo<T> {
|
||||
fn transfer() -> Weight {
|
||||
(65949000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn transfer_keep_alive() -> Weight {
|
||||
(46665000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_balance_creating() -> Weight {
|
||||
(27086000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_balance_killing() -> Weight {
|
||||
(33424000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_transfer() -> Weight {
|
||||
(65343000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,80 +18,81 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_collective::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
fn set_members(m: u32, n: u32, p: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((21040000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((173000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add((31595000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
}
|
||||
fn execute(b: u32, m: u32, ) -> Weight {
|
||||
(43359000 as Weight)
|
||||
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add((123000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
}
|
||||
fn propose_execute(b: u32, m: u32, ) -> Weight {
|
||||
(54134000 as Weight)
|
||||
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add((239000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
}
|
||||
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
(90650000 as Weight)
|
||||
.saturating_add((5000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add((152000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((970000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn vote(m: u32, ) -> Weight {
|
||||
(74460000 as Weight)
|
||||
.saturating_add((290000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
(86360000 as Weight)
|
||||
.saturating_add((232000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((954000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
(123653000 as Weight)
|
||||
.saturating_add((1000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add((287000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((920000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn close_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
(95395000 as Weight)
|
||||
.saturating_add((236000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((965000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
(135284000 as Weight)
|
||||
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add((218000 as Weight).saturating_mul(m as Weight))
|
||||
.saturating_add((951000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn disapprove_proposal(p: u32, ) -> Weight {
|
||||
(50500000 as Weight)
|
||||
.saturating_add((966000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,140 +16,141 @@
|
||||
//! Weights for the Democracy Pallet
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_democracy::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_democracy::WeightInfo for WeightInfo<T> {
|
||||
fn propose() -> Weight {
|
||||
(49113000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn second(s: u32, ) -> Weight {
|
||||
(42067000 as Weight)
|
||||
.saturating_add((220000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn vote_new(r: u32, ) -> Weight {
|
||||
(54159000 as Weight)
|
||||
.saturating_add((252000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn vote_existing(r: u32, ) -> Weight {
|
||||
(54145000 as Weight)
|
||||
.saturating_add((262000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn emergency_cancel() -> Weight {
|
||||
(31071000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn external_propose(v: u32, ) -> Weight {
|
||||
(14282000 as Weight)
|
||||
.saturating_add((109000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn external_propose_majority() -> Weight {
|
||||
(3478000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn external_propose_default() -> Weight {
|
||||
(3442000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn fast_track() -> Weight {
|
||||
(30820000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn veto_external(v: u32, ) -> Weight {
|
||||
(30971000 as Weight)
|
||||
.saturating_add((184000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn cancel_referendum() -> Weight {
|
||||
(20431000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn cancel_queued(r: u32, ) -> Weight {
|
||||
(42438000 as Weight)
|
||||
.saturating_add((3284000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn on_initialize_base(r: u32, ) -> Weight {
|
||||
(70826000 as Weight)
|
||||
.saturating_add((10716000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((2 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(5 as Weight))
|
||||
}
|
||||
fn delegate(r: u32, ) -> Weight {
|
||||
(72046000 as Weight)
|
||||
.saturating_add((7837000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
|
||||
}
|
||||
fn undelegate(r: u32, ) -> Weight {
|
||||
(41028000 as Weight)
|
||||
.saturating_add((7810000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
|
||||
}
|
||||
fn clear_public_proposals() -> Weight {
|
||||
(3643000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn note_preimage(b: u32, ) -> Weight {
|
||||
(46629000 as Weight)
|
||||
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn note_imminent_preimage(b: u32, ) -> Weight {
|
||||
(31147000 as Weight)
|
||||
.saturating_add((3000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn reap_preimage(b: u32, ) -> Weight {
|
||||
(42848000 as Weight)
|
||||
.saturating_add((3000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn unlock_remove(r: u32, ) -> Weight {
|
||||
(45333000 as Weight)
|
||||
.saturating_add((171000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn unlock_set(r: u32, ) -> Weight {
|
||||
(44424000 as Weight)
|
||||
.saturating_add((291000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn remove_vote(r: u32, ) -> Weight {
|
||||
(28250000 as Weight)
|
||||
.saturating_add((283000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn remove_other_vote(r: u32, ) -> Weight {
|
||||
(28250000 as Weight)
|
||||
.saturating_add((283000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,70 +20,71 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_elections_phragmen::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_elections_phragmen::WeightInfo for WeightInfo<T> {
|
||||
fn vote(v: u32, ) -> Weight {
|
||||
(91_489_000 as Weight)
|
||||
.saturating_add((199_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn vote_update(v: u32, ) -> Weight {
|
||||
(56_511_000 as Weight)
|
||||
.saturating_add((245_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn remove_voter() -> Weight {
|
||||
(76_714_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn report_defunct_voter_correct(c: u32, v: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((1_743_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add((31_750_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn report_defunct_voter_incorrect(c: u32, v: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((1_733_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add((31_861_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn submit_candidacy(c: u32, ) -> Weight {
|
||||
(74_714_000 as Weight)
|
||||
.saturating_add((315_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn renounce_candidacy_candidate(c: u32, ) -> Weight {
|
||||
(50_408_000 as Weight)
|
||||
.saturating_add((159_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn renounce_candidacy_members() -> Weight {
|
||||
(79_626_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn renounce_candidacy_runners_up() -> Weight {
|
||||
(49_715_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn remove_member_with_replacement() -> Weight {
|
||||
(76_572_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(5 as Weight))
|
||||
}
|
||||
fn remove_member_wrong_refund() -> Weight {
|
||||
(8_777_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,117 +20,118 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_identity::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_identity::WeightInfo for WeightInfo<T> {
|
||||
fn add_registrar(r: u32, ) -> Weight {
|
||||
(39_603_000 as Weight)
|
||||
.saturating_add((418_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_identity(r: u32, x: u32, ) -> Weight {
|
||||
(110_679_000 as Weight)
|
||||
.saturating_add((389_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((2_985_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_subs_new(s: u32, ) -> Weight {
|
||||
(78_697_000 as Weight)
|
||||
.saturating_add((15_225_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn set_subs_old(p: u32, ) -> Weight {
|
||||
(71_308_000 as Weight)
|
||||
.saturating_add((5_772_000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
|
||||
}
|
||||
fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight {
|
||||
(91_553_000 as Weight)
|
||||
.saturating_add((284_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((5_749_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((1_621_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn request_judgement(r: u32, x: u32, ) -> Weight {
|
||||
(110_856_000 as Weight)
|
||||
.saturating_add((496_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((3_221_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn cancel_request(r: u32, x: u32, ) -> Weight {
|
||||
(96_857_000 as Weight)
|
||||
.saturating_add((311_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((3_204_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_fee(r: u32, ) -> Weight {
|
||||
(16_276_000 as Weight)
|
||||
.saturating_add((381_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_account_id(r: u32, ) -> Weight {
|
||||
(18_530_000 as Weight)
|
||||
.saturating_add((391_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_fields(r: u32, ) -> Weight {
|
||||
(16_359_000 as Weight)
|
||||
.saturating_add((379_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn provide_judgement(r: u32, x: u32, ) -> Weight {
|
||||
(72_869_000 as Weight)
|
||||
.saturating_add((423_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((3_187_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight {
|
||||
(123_199_000 as Weight)
|
||||
.saturating_add((71_000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((5_730_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((2_000 as Weight).saturating_mul(x as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn add_sub(s: u32, ) -> Weight {
|
||||
(110_070_000 as Weight)
|
||||
.saturating_add((262_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn rename_sub(s: u32, ) -> Weight {
|
||||
(37_130_000 as Weight)
|
||||
.saturating_add((79_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn remove_sub(s: u32, ) -> Weight {
|
||||
(103_295_000 as Weight)
|
||||
.saturating_add((235_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn quit_sub(s: u32, ) -> Weight {
|
||||
(65_716_000 as Weight)
|
||||
.saturating_add((227_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,15 +20,16 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_im_online::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_im_online::WeightInfo for WeightInfo<T> {
|
||||
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
|
||||
(139830000 as Weight)
|
||||
.saturating_add((211000 as Weight).saturating_mul(k as Weight))
|
||||
.saturating_add((654000 as Weight).saturating_mul(e as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,33 +20,34 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_indices::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_indices::WeightInfo for WeightInfo<T> {
|
||||
fn claim() -> Weight {
|
||||
(56_237_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn transfer() -> Weight {
|
||||
(63_665_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn free() -> Weight {
|
||||
(50_736_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_transfer() -> Weight {
|
||||
(52_361_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn freeze() -> Weight {
|
||||
(46_483_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_multisig::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_multisig::WeightInfo for WeightInfo<T> {
|
||||
fn as_multi_threshold_1(z: u32, ) -> Weight {
|
||||
(17_161_000 as Weight)
|
||||
.saturating_add((1_000 as Weight).saturating_mul(z as Weight))
|
||||
@@ -32,59 +33,59 @@ impl pallet_multisig::WeightInfo for WeightInfo {
|
||||
(79_857_000 as Weight)
|
||||
.saturating_add((131_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((1_000 as Weight).saturating_mul(z as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
|
||||
(90_218_000 as Weight)
|
||||
.saturating_add((129_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
|
||||
(48_402_000 as Weight)
|
||||
.saturating_add((132_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((1_000 as Weight).saturating_mul(z as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
|
||||
(88_390_000 as Weight)
|
||||
.saturating_add((120_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
|
||||
(98_960_000 as Weight)
|
||||
.saturating_add((276_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add((6_000 as Weight).saturating_mul(z as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn approve_as_multi_create(s: u32, ) -> Weight {
|
||||
(80_185_000 as Weight)
|
||||
.saturating_add((121_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn approve_as_multi_approve(s: u32, ) -> Weight {
|
||||
(48_386_000 as Weight)
|
||||
.saturating_add((143_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn approve_as_multi_complete(s: u32, ) -> Weight {
|
||||
(177_181_000 as Weight)
|
||||
.saturating_add((273_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn cancel_as_multi(s: u32, ) -> Weight {
|
||||
(126_334_000 as Weight)
|
||||
.saturating_add((124_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,71 +15,72 @@
|
||||
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_proxy::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_proxy::WeightInfo for WeightInfo<T> {
|
||||
fn proxy(p: u32, ) -> Weight {
|
||||
(26127000 as Weight)
|
||||
.saturating_add((214000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
}
|
||||
fn proxy_announced(a: u32, p: u32, ) -> Weight {
|
||||
(55405000 as Weight)
|
||||
.saturating_add((774000 as Weight).saturating_mul(a as Weight))
|
||||
.saturating_add((209000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn remove_announcement(a: u32, p: u32, ) -> Weight {
|
||||
(35879000 as Weight)
|
||||
.saturating_add((783000 as Weight).saturating_mul(a as Weight))
|
||||
.saturating_add((20000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn reject_announcement(a: u32, p: u32, ) -> Weight {
|
||||
(36097000 as Weight)
|
||||
.saturating_add((780000 as Weight).saturating_mul(a as Weight))
|
||||
.saturating_add((12000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn announce(a: u32, p: u32, ) -> Weight {
|
||||
(53769000 as Weight)
|
||||
.saturating_add((675000 as Weight).saturating_mul(a as Weight))
|
||||
.saturating_add((214000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn add_proxy(p: u32, ) -> Weight {
|
||||
(36082000 as Weight)
|
||||
.saturating_add((234000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn remove_proxy(p: u32, ) -> Weight {
|
||||
(32885000 as Weight)
|
||||
.saturating_add((267000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn remove_proxies(p: u32, ) -> Weight {
|
||||
(31735000 as Weight)
|
||||
.saturating_add((215000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn anonymous(p: u32, ) -> Weight {
|
||||
(50907000 as Weight)
|
||||
.saturating_add((61000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn kill_anonymous(p: u32, ) -> Weight {
|
||||
(33926000 as Weight)
|
||||
.saturating_add((208000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,32 +20,33 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_scheduler::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_scheduler::WeightInfo for WeightInfo<T> {
|
||||
fn schedule(s: u32, ) -> Weight {
|
||||
(37_835_000 as Weight)
|
||||
.saturating_add((81_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn cancel(s: u32, ) -> Weight {
|
||||
(34_707_000 as Weight)
|
||||
.saturating_add((3_125_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn schedule_named(s: u32, ) -> Weight {
|
||||
(48_065_000 as Weight)
|
||||
.saturating_add((110_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn cancel_named(s: u32, ) -> Weight {
|
||||
(38_776_000 as Weight)
|
||||
.saturating_add((3_138_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,19 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_session::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_session::WeightInfo for WeightInfo<T> {
|
||||
fn set_keys() -> Weight {
|
||||
(88_411_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(5 as Weight))
|
||||
}
|
||||
fn purge_keys() -> Weight {
|
||||
(51_843_000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(5 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,140 +21,141 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_staking::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_staking::WeightInfo for WeightInfo<T> {
|
||||
fn bond() -> Weight {
|
||||
(144278000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn bond_extra() -> Weight {
|
||||
(110715000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn unbond() -> Weight {
|
||||
(99840000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn withdraw_unbonded_update(s: u32, ) -> Weight {
|
||||
(100728000 as Weight)
|
||||
.saturating_add((63000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn withdraw_unbonded_kill(s: u32, ) -> Weight {
|
||||
(168879000 as Weight)
|
||||
.saturating_add((6666000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn validate() -> Weight {
|
||||
(35539000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn nominate(n: u32, ) -> Weight {
|
||||
(48596000 as Weight)
|
||||
.saturating_add((308000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn chill() -> Weight {
|
||||
(35144000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn set_payee() -> Weight {
|
||||
(24255000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_controller() -> Weight {
|
||||
(52294000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn set_validator_count() -> Weight {
|
||||
(5185000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_no_eras() -> Weight {
|
||||
(5907000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_new_era() -> Weight {
|
||||
(5917000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_new_era_always() -> Weight {
|
||||
(5952000 as Weight)
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn set_invulnerables(v: u32, ) -> Weight {
|
||||
(6324000 as Weight)
|
||||
.saturating_add((9000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn force_unstake(s: u32, ) -> Weight {
|
||||
(119691000 as Weight)
|
||||
.saturating_add((6681000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn cancel_deferred_slash(s: u32, ) -> Weight {
|
||||
(5820201000 as Weight)
|
||||
.saturating_add((34672000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn payout_stakers_dead_controller(n: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((92486000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
|
||||
}
|
||||
fn payout_stakers_alive_staked(n: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((117324000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add(DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
|
||||
}
|
||||
fn rebond(l: u32, ) -> Weight {
|
||||
(71316000 as Weight)
|
||||
.saturating_add((142000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn set_history_depth(e: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((51901000 as Weight).saturating_mul(e as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
|
||||
}
|
||||
fn reap_stash(s: u32, ) -> Weight {
|
||||
(147166000 as Weight)
|
||||
.saturating_add((6661000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
}
|
||||
fn new_era(v: u32, n: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
.saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add((182580000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add(DbWeight::get().reads(10 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
|
||||
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(10 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
|
||||
}
|
||||
fn submit_solution_better(v: u32, n: u32, a: u32, w: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
@@ -162,9 +163,9 @@ impl pallet_staking::WeightInfo for WeightInfo {
|
||||
.saturating_add((432000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add((204294000 as Weight).saturating_mul(a as Weight))
|
||||
.saturating_add((9546000 as Weight).saturating_mul(w as Weight))
|
||||
.saturating_add(DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
|
||||
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,15 +17,16 @@
|
||||
|
||||
#![allow(unused_parens)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_timestamp::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_timestamp::WeightInfo for WeightInfo<T> {
|
||||
// WARNING! Some components were not used: ["t"]
|
||||
fn set() -> Weight {
|
||||
(9133000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// WARNING! Some components were not used: ["t"]
|
||||
fn on_finalize() -> Weight {
|
||||
|
||||
@@ -20,121 +20,122 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_treasury::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_treasury::WeightInfo for WeightInfo<T> {
|
||||
fn propose_spend() -> Weight {
|
||||
(79604000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn reject_proposal() -> Weight {
|
||||
(61001000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn approve_proposal() -> Weight {
|
||||
(17835000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn report_awesome(r: u32, ) -> Weight {
|
||||
(101602000 as Weight)
|
||||
.saturating_add((2000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
// WARNING! Some components were not used: ["r"]
|
||||
fn retract_tip() -> Weight {
|
||||
(82970000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn tip_new(r: u32, t: u32, ) -> Weight {
|
||||
(63995000 as Weight)
|
||||
.saturating_add((2000 as Weight).saturating_mul(r as Weight))
|
||||
.saturating_add((153000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn tip(t: u32, ) -> Weight {
|
||||
(46765000 as Weight)
|
||||
.saturating_add((711000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn close_tip(t: u32, ) -> Weight {
|
||||
(160874000 as Weight)
|
||||
.saturating_add((379000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn propose_bounty(d: u32, ) -> Weight {
|
||||
(86198000 as Weight)
|
||||
.saturating_add((1000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn approve_bounty() -> Weight {
|
||||
(23063000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn propose_curator() -> Weight {
|
||||
(18890000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn unassign_curator() -> Weight {
|
||||
(66768000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn accept_curator() -> Weight {
|
||||
(69131000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn award_bounty() -> Weight {
|
||||
(48184000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn claim_bounty() -> Weight {
|
||||
(243104000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(5 as Weight))
|
||||
}
|
||||
fn close_bounty_proposed() -> Weight {
|
||||
(65917000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn close_bounty_active() -> Weight {
|
||||
(157232000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn extend_bounty_expiry() -> Weight {
|
||||
(46216000 as Weight)
|
||||
.saturating_add(DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn on_initialize_proposals(p: u32, ) -> Weight {
|
||||
(119765000 as Weight)
|
||||
.saturating_add((108368000 as Weight).saturating_mul(p as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight)))
|
||||
}
|
||||
fn on_initialize_bounties(b: u32, ) -> Weight {
|
||||
(112536000 as Weight)
|
||||
.saturating_add((107132000 as Weight).saturating_mul(b as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight)))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_utility::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_utility::WeightInfo for WeightInfo<T> {
|
||||
fn batch(c: u32, ) -> Weight {
|
||||
(16461000 as Weight)
|
||||
.saturating_add((1982000 as Weight).saturating_mul(c as Weight))
|
||||
|
||||
@@ -20,44 +20,45 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
pub struct WeightInfo;
|
||||
impl pallet_vesting::WeightInfo for WeightInfo {
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Trait> pallet_vesting::WeightInfo for WeightInfo<T> {
|
||||
fn vest_locked(l: u32, ) -> Weight {
|
||||
(82109000 as Weight)
|
||||
.saturating_add((332000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn vest_unlocked(l: u32, ) -> Weight {
|
||||
(88419000 as Weight)
|
||||
.saturating_add((3000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn vest_other_locked(l: u32, ) -> Weight {
|
||||
(81277000 as Weight)
|
||||
.saturating_add((321000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn vest_other_unlocked(l: u32, ) -> Weight {
|
||||
(87584000 as Weight)
|
||||
.saturating_add((19000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn vested_transfer(l: u32, ) -> Weight {
|
||||
(185916000 as Weight)
|
||||
.saturating_add((625000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
fn force_vested_transfer(l: u32, ) -> Weight {
|
||||
(185916000 as Weight)
|
||||
.saturating_add((625000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ sp-runtime = { version = "2.0.0", path = "../../../primitives/runtime" }
|
||||
sp-state-machine = { version = "0.8.0", path = "../../../primitives/state-machine" }
|
||||
structopt = "0.3.8"
|
||||
codec = { version = "1.3.1", package = "parity-scale-codec" }
|
||||
chrono = "0.4"
|
||||
|
||||
[features]
|
||||
default = ["db"]
|
||||
|
||||
@@ -41,6 +41,14 @@ impl BenchmarkCmd {
|
||||
<BB as BlockT>::Hash: std::str::FromStr,
|
||||
ExecDispatch: NativeExecutionDispatch + 'static,
|
||||
{
|
||||
if let Some(output_path) = &self.output {
|
||||
if !output_path.is_dir() { return Err("Output path is invalid!".into()) };
|
||||
}
|
||||
|
||||
if let Some(header_file) = &self.header {
|
||||
if !header_file.is_file() { return Err("Header file is invalid!".into()) };
|
||||
}
|
||||
|
||||
let spec = config.chain_spec;
|
||||
let wasm_method = self.wasm_method.into();
|
||||
let strategy = self.execution.unwrap_or(ExecutionStrategy::Native);
|
||||
@@ -91,12 +99,22 @@ impl BenchmarkCmd {
|
||||
match results {
|
||||
Ok(batches) => {
|
||||
// If we are going to output results to a file...
|
||||
if self.output {
|
||||
if self.weight_trait {
|
||||
let mut file = crate::writer::open_file("traits.rs")?;
|
||||
crate::writer::write_trait(&mut file, batches.clone())?;
|
||||
if let Some(output_path) = &self.output {
|
||||
if self.trait_def {
|
||||
crate::writer::write_trait(&batches, output_path, &self.r#trait, self.spaces)?;
|
||||
} else {
|
||||
crate::writer::write_results(&batches)?;
|
||||
crate::writer::write_results(
|
||||
&batches,
|
||||
output_path,
|
||||
&self.lowest_range_values,
|
||||
&self.highest_range_values,
|
||||
&self.steps,
|
||||
self.repeat,
|
||||
&self.header,
|
||||
&self.r#struct,
|
||||
&self.r#trait,
|
||||
self.spaces
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,17 @@ pub struct BenchmarkCmd {
|
||||
#[structopt(long)]
|
||||
pub no_min_squares: bool,
|
||||
|
||||
/// Output the benchmarks to a Rust file.
|
||||
/// Output the benchmarks to a Rust file at the given path.
|
||||
#[structopt(long)]
|
||||
pub output: bool,
|
||||
pub output: Option<std::path::PathBuf>,
|
||||
|
||||
/// Add a header file to your outputted benchmarks
|
||||
#[structopt(long)]
|
||||
pub header: Option<std::path::PathBuf>,
|
||||
|
||||
/// Output the trait definition to a Rust file.
|
||||
#[structopt(long)]
|
||||
pub weight_trait: bool,
|
||||
pub trait_def: bool,
|
||||
|
||||
/// Set the heap pages while running benchmarks.
|
||||
#[structopt(long)]
|
||||
@@ -80,6 +84,18 @@ pub struct BenchmarkCmd {
|
||||
#[structopt(long)]
|
||||
pub extra: bool,
|
||||
|
||||
/// Output files using spaces instead of tabs.
|
||||
#[structopt(long)]
|
||||
pub spaces: bool,
|
||||
|
||||
/// Output benchmarks file using this struct name.
|
||||
#[structopt(long, default_value = "WeightInfo")]
|
||||
pub r#struct: String,
|
||||
|
||||
/// Output benchmarks file using this trait name.
|
||||
#[structopt(long, default_value = "WeightInfo")]
|
||||
pub r#trait: String,
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
pub shared_params: sc_cli::SharedParams,
|
||||
|
||||
@@ -17,14 +17,15 @@
|
||||
|
||||
// Outputs benchmark results to Rust files that can be ingested by the runtime.
|
||||
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::fs::{self, File, OpenOptions};
|
||||
use std::io::prelude::*;
|
||||
use std::path::PathBuf;
|
||||
use frame_benchmarking::{BenchmarkBatch, BenchmarkSelector, Analysis};
|
||||
use sp_runtime::traits::Zero;
|
||||
|
||||
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
pub fn open_file(path: &str) -> Result<File, std::io::Error> {
|
||||
pub fn open_file(path: PathBuf) -> Result<File, std::io::Error> {
|
||||
OpenOptions::new()
|
||||
.create(true)
|
||||
.write(true)
|
||||
@@ -35,25 +36,37 @@ pub fn open_file(path: &str) -> Result<File, std::io::Error> {
|
||||
fn underscore<Number>(i: Number) -> String
|
||||
where Number: std::string::ToString
|
||||
{
|
||||
let mut s = String::new();
|
||||
let i_str = i.to_string();
|
||||
let a = i_str.chars().rev().enumerate();
|
||||
for (idx, val) in a {
|
||||
if idx != 0 && idx % 3 == 0 {
|
||||
s.insert(0, '_');
|
||||
}
|
||||
s.insert(0, val);
|
||||
}
|
||||
s
|
||||
let mut s = String::new();
|
||||
let i_str = i.to_string();
|
||||
let a = i_str.chars().rev().enumerate();
|
||||
for (idx, val) in a {
|
||||
if idx != 0 && idx % 3 == 0 {
|
||||
s.insert(0, '_');
|
||||
}
|
||||
s.insert(0, val);
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
pub fn write_trait(file: &mut File, batches: Vec<BenchmarkBatch>) -> Result<(), std::io::Error> {
|
||||
pub fn write_trait(
|
||||
batches: &[BenchmarkBatch],
|
||||
path: &PathBuf,
|
||||
trait_name: &String,
|
||||
spaces: bool,
|
||||
) -> Result<(), std::io::Error> {
|
||||
let mut file_path = path.clone();
|
||||
file_path.push("trait");
|
||||
file_path.set_extension("rs");
|
||||
let mut file = crate::writer::open_file(file_path)?;
|
||||
|
||||
let indent = if spaces {" "} else {"\t"};
|
||||
|
||||
let mut current_pallet = Vec::<u8>::new();
|
||||
|
||||
// Skip writing if there are no batches
|
||||
if batches.is_empty() { return Ok(()) }
|
||||
|
||||
for batch in &batches {
|
||||
for batch in batches {
|
||||
// Skip writing if there are no results
|
||||
if batch.results.is_empty() { continue }
|
||||
|
||||
@@ -69,13 +82,13 @@ pub fn write_trait(file: &mut File, batches: Vec<BenchmarkBatch>) -> Result<(),
|
||||
|
||||
// trait wrapper
|
||||
write!(file, "// {}\n", pallet_string)?;
|
||||
write!(file, "pub trait WeightInfo {{\n")?;
|
||||
write!(file, "pub trait {} {{\n", trait_name)?;
|
||||
|
||||
current_pallet = batch.pallet.clone()
|
||||
}
|
||||
|
||||
// function name
|
||||
write!(file, "\tfn {}(", benchmark_string)?;
|
||||
write!(file, "{}fn {}(", indent, benchmark_string)?;
|
||||
|
||||
// params
|
||||
let components = &batch.results[0].components;
|
||||
@@ -92,7 +105,30 @@ pub fn write_trait(file: &mut File, batches: Vec<BenchmarkBatch>) -> Result<(),
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
pub fn write_results(
|
||||
batches: &[BenchmarkBatch],
|
||||
path: &PathBuf,
|
||||
lowest_range_values: &[u32],
|
||||
highest_range_values: &[u32],
|
||||
steps: &[u32],
|
||||
repeat: u32,
|
||||
header: &Option<PathBuf>,
|
||||
struct_name: &String,
|
||||
trait_name: &String,
|
||||
spaces: bool,
|
||||
) -> Result<(), std::io::Error> {
|
||||
|
||||
let header_text = match header {
|
||||
Some(header_file) => {
|
||||
let text = fs::read_to_string(header_file)?;
|
||||
Some(text)
|
||||
},
|
||||
None => None,
|
||||
};
|
||||
|
||||
let indent = if spaces {" "} else {"\t"};
|
||||
let date = chrono::Utc::now();
|
||||
|
||||
let mut current_pallet = Vec::<u8>::new();
|
||||
|
||||
// Skip writing if there are no batches
|
||||
@@ -103,8 +139,12 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
let first_pallet = String::from_utf8(
|
||||
batches_iter.peek().expect("we checked that batches is not empty").pallet.clone()
|
||||
).unwrap();
|
||||
let mut file = open_file(&(first_pallet + ".rs"))?;
|
||||
|
||||
let mut file_path = path.clone();
|
||||
file_path.push(first_pallet);
|
||||
file_path.set_extension("rs");
|
||||
|
||||
let mut file = open_file(file_path)?;
|
||||
|
||||
while let Some(batch) = batches_iter.next() {
|
||||
// Skip writing if there are no results
|
||||
@@ -115,11 +155,30 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
|
||||
// only create new trait definitions when we go to a new pallet
|
||||
if batch.pallet != current_pallet {
|
||||
// optional header and copyright
|
||||
if let Some(header) = &header_text {
|
||||
write!(file, "{}\n", header)?;
|
||||
}
|
||||
|
||||
// title of file
|
||||
write!(file, "//! Weights for {}\n", pallet_string)?;
|
||||
|
||||
// auto-generation note
|
||||
write!(
|
||||
file,
|
||||
"//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {}\n\n",
|
||||
VERSION,
|
||||
"//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {}\n",
|
||||
VERSION,
|
||||
)?;
|
||||
|
||||
// date of generation
|
||||
write!(
|
||||
file,
|
||||
"//! DATE: {}, STEPS: {:?}, REPEAT: {}, LOW RANGE: {:?}, HIGH RANGE: {:?}\n\n",
|
||||
date.format("%Y-%m-%d"),
|
||||
steps,
|
||||
repeat,
|
||||
lowest_range_values,
|
||||
highest_range_values,
|
||||
)?;
|
||||
|
||||
// allow statements
|
||||
@@ -131,14 +190,20 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
// general imports
|
||||
write!(
|
||||
file,
|
||||
"use frame_support::weights::{{Weight, constants::RocksDbWeight as DbWeight}};\n\n"
|
||||
"use frame_support::{{traits::Get, weights::Weight}};\nuse sp_std::marker::PhantomData;\n\n"
|
||||
)?;
|
||||
|
||||
// struct for weights
|
||||
write!(file, "pub struct WeightInfo;\n")?;
|
||||
write!(file, "pub struct {}<T>(PhantomData<T>);\n", struct_name)?;
|
||||
|
||||
// trait wrapper
|
||||
write!(file, "impl {}::WeightInfo for WeightInfo {{\n", pallet_string)?;
|
||||
write!(
|
||||
file,
|
||||
"impl<T: frame_system::Trait> {}::{} for {}<T> {{\n",
|
||||
pallet_string,
|
||||
trait_name,
|
||||
struct_name,
|
||||
)?;
|
||||
|
||||
current_pallet = batch.pallet.clone()
|
||||
}
|
||||
@@ -179,11 +244,11 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
if all_components.len() != used_components.len() {
|
||||
let mut unused_components = all_components;
|
||||
unused_components.retain(|x| !used_components.contains(&x));
|
||||
write!(file, "\t// WARNING! Some components were not used: {:?}\n", unused_components)?;
|
||||
write!(file, "{}// WARNING! Some components were not used: {:?}\n", indent, unused_components)?;
|
||||
}
|
||||
|
||||
// function name
|
||||
write!(file, "\tfn {}(", benchmark_string)?;
|
||||
write!(file, "{}fn {}(", indent, benchmark_string)?;
|
||||
// params
|
||||
for component in used_components {
|
||||
write!(file, "{}: u32, ", component)?;
|
||||
@@ -191,36 +256,55 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
// return value
|
||||
write!(file, ") -> Weight {{\n")?;
|
||||
|
||||
write!(file, "\t\t({} as Weight)\n", underscore(extrinsic_time.base.saturating_mul(1000)))?;
|
||||
write!(file, "{}{}({} as Weight)\n", indent, indent, underscore(extrinsic_time.base.saturating_mul(1000)))?;
|
||||
used_extrinsic_time.iter().try_for_each(|(slope, name)| -> Result<(), std::io::Error> {
|
||||
write!(file, "\t\t\t.saturating_add(({} as Weight).saturating_mul({} as Weight))\n",
|
||||
write!(
|
||||
file,
|
||||
"{}{}{}.saturating_add(({} as Weight).saturating_mul({} as Weight))\n",
|
||||
indent, indent, indent,
|
||||
underscore(slope.saturating_mul(1000)),
|
||||
name,
|
||||
)
|
||||
})?;
|
||||
|
||||
if !reads.base.is_zero() {
|
||||
write!(file, "\t\t\t.saturating_add(DbWeight::get().reads({} as Weight))\n", reads.base)?;
|
||||
write!(
|
||||
file,
|
||||
"{}{}{}.saturating_add(T::DbWeight::get().reads({} as Weight))\n",
|
||||
indent, indent, indent,
|
||||
reads.base,
|
||||
)?;
|
||||
}
|
||||
used_reads.iter().try_for_each(|(slope, name)| -> Result<(), std::io::Error> {
|
||||
write!(file, "\t\t\t.saturating_add(DbWeight::get().reads(({} as Weight).saturating_mul({} as Weight)))\n",
|
||||
write!(
|
||||
file,
|
||||
"{}{}{}.saturating_add(T::DbWeight::get().reads(({} as Weight).saturating_mul({} as Weight)))\n",
|
||||
indent, indent, indent,
|
||||
slope,
|
||||
name,
|
||||
)
|
||||
})?;
|
||||
|
||||
if !writes.base.is_zero() {
|
||||
write!(file, "\t\t\t.saturating_add(DbWeight::get().writes({} as Weight))\n", writes.base)?;
|
||||
write!(
|
||||
file,
|
||||
"{}{}{}.saturating_add(T::DbWeight::get().writes({} as Weight))\n",
|
||||
indent, indent, indent,
|
||||
writes.base,
|
||||
)?;
|
||||
}
|
||||
used_writes.iter().try_for_each(|(slope, name)| -> Result<(), std::io::Error> {
|
||||
write!(file, "\t\t\t.saturating_add(DbWeight::get().writes(({} as Weight).saturating_mul({} as Weight)))\n",
|
||||
write!(
|
||||
file,
|
||||
"{}{}{}.saturating_add(T::DbWeight::get().writes(({} as Weight).saturating_mul({} as Weight)))\n",
|
||||
indent, indent, indent,
|
||||
slope,
|
||||
name,
|
||||
)
|
||||
})?;
|
||||
|
||||
// close function
|
||||
write!(file, "\t}}\n")?;
|
||||
write!(file, "{}}}\n", indent)?;
|
||||
|
||||
// Check if this is the end of the iterator
|
||||
if let Some(next) = batches_iter.peek() {
|
||||
@@ -228,7 +312,11 @@ pub fn write_results(batches: &[BenchmarkBatch]) -> Result<(), std::io::Error> {
|
||||
if next.pallet != current_pallet {
|
||||
write!(file, "}}\n")?;
|
||||
let next_pallet = String::from_utf8(next.pallet.clone()).unwrap();
|
||||
file = open_file(&(next_pallet + ".rs"))?;
|
||||
|
||||
let mut file_path = path.clone();
|
||||
file_path.push(next_pallet);
|
||||
file_path.set_extension("rs");
|
||||
file = open_file(file_path)?;
|
||||
}
|
||||
} else {
|
||||
// This is the end of the iterator, so we close up the final file.
|
||||
|
||||
Reference in New Issue
Block a user