mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 13:31:04 +00:00
7808b0c349
* Add stepped curve for referenda * Treasury SpendOrigin * Add tests * Better Origin Or-gating * Reciprocal curve * Tests for reciprical and rounding in PerThings * Tweaks and new quad curve * Const derivation of reciprocal curve parameters * Remove some unneeded code * Actually useful linear curve * Fixes * Provisional curves * Rejig 'turnout' as 'support' * Use TypedGet * Fixes * Enable curve's ceil to be configured * Formatting * Fixes * Fixes * Fixes * Remove EnsureOneOf * Fixes * Fixes * Fixes * Formatting * Fixes * Update frame/support/src/traits/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Grumbles * Formatting * Fixes * APIs of VoteTally should include class * Fixes * Fix overlay prefix removal result * Second part of the overlay prefix removal fix. * Formatting * Fixes * Add some tests and make clear rounding algo * Fixes * Formatting * Revert questionable fix * Introduce test for kill_prefix * Fixes * Formatting * Fixes * Fix possible overflow * Docs * Add benchmark test * Formatting * Update frame/referenda/src/types.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Docs * Fixes * Use latest API in tests * Formatting * Whitespace * Use latest API in tests Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
161 lines
6.0 KiB
Rust
161 lines
6.0 KiB
Rust
// This file is part of Substrate.
|
|
|
|
// Copyright (C) 2022 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.
|
|
|
|
//! Autogenerated weights for pallet_treasury
|
|
//!
|
|
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
|
//! DATE: 2022-05-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
|
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
|
|
|
// Executed Command:
|
|
// ./target/production/substrate
|
|
// benchmark
|
|
// pallet
|
|
// --chain=dev
|
|
// --steps=50
|
|
// --repeat=20
|
|
// --pallet=pallet_treasury
|
|
// --extrinsic=*
|
|
// --execution=wasm
|
|
// --wasm-execution=compiled
|
|
// --template=./.maintain/frame-weight-template.hbs
|
|
// --output=./frame/treasury/src/weights.rs
|
|
|
|
#![cfg_attr(rustfmt, rustfmt_skip)]
|
|
#![allow(unused_parens)]
|
|
#![allow(unused_imports)]
|
|
|
|
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
|
use sp_std::marker::PhantomData;
|
|
|
|
/// Weight functions needed for pallet_treasury.
|
|
pub trait WeightInfo {
|
|
fn spend() -> Weight;
|
|
fn propose_spend() -> Weight;
|
|
fn reject_proposal() -> Weight;
|
|
fn approve_proposal(p: u32, ) -> Weight;
|
|
fn remove_approval() -> Weight;
|
|
fn on_initialize_proposals(p: u32, ) -> Weight;
|
|
}
|
|
|
|
/// Weights for pallet_treasury using the Substrate node and recommended hardware.
|
|
pub struct SubstrateWeight<T>(PhantomData<T>);
|
|
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
|
// Storage: Treasury ProposalCount (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:0 w:1)
|
|
fn spend() -> Weight {
|
|
(22_063_000 as Weight)
|
|
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
|
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury ProposalCount (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:0 w:1)
|
|
fn propose_spend() -> Weight {
|
|
(26_473_000 as Weight)
|
|
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
|
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury Proposals (r:1 w:1)
|
|
// Storage: System Account (r:1 w:1)
|
|
fn reject_proposal() -> Weight {
|
|
(29_955_000 as Weight)
|
|
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
|
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury Proposals (r:1 w:0)
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
fn approve_proposal(p: u32, ) -> Weight {
|
|
(10_786_000 as Weight)
|
|
// Standard Error: 0
|
|
.saturating_add((110_000 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))
|
|
}
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
fn remove_approval() -> Weight {
|
|
(6_647_000 as Weight)
|
|
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
|
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
|
}
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
// Storage: Bounties BountyApprovals (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:2 w:2)
|
|
// Storage: System Account (r:4 w:4)
|
|
fn on_initialize_proposals(p: u32, ) -> Weight {
|
|
(25_805_000 as Weight)
|
|
// Standard Error: 18_000
|
|
.saturating_add((28_473_000 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)))
|
|
}
|
|
}
|
|
|
|
// For backwards compatibility and tests
|
|
impl WeightInfo for () {
|
|
// Storage: Treasury ProposalCount (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:0 w:1)
|
|
fn spend() -> Weight {
|
|
(22_063_000 as Weight)
|
|
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury ProposalCount (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:0 w:1)
|
|
fn propose_spend() -> Weight {
|
|
(26_473_000 as Weight)
|
|
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury Proposals (r:1 w:1)
|
|
// Storage: System Account (r:1 w:1)
|
|
fn reject_proposal() -> Weight {
|
|
(29_955_000 as Weight)
|
|
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
|
}
|
|
// Storage: Treasury Proposals (r:1 w:0)
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
fn approve_proposal(p: u32, ) -> Weight {
|
|
(10_786_000 as Weight)
|
|
// Standard Error: 0
|
|
.saturating_add((110_000 as Weight).saturating_mul(p as Weight))
|
|
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
|
}
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
fn remove_approval() -> Weight {
|
|
(6_647_000 as Weight)
|
|
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
|
}
|
|
// Storage: Treasury Approvals (r:1 w:1)
|
|
// Storage: Bounties BountyApprovals (r:1 w:1)
|
|
// Storage: Treasury Proposals (r:2 w:2)
|
|
// Storage: System Account (r:4 w:4)
|
|
fn on_initialize_proposals(p: u32, ) -> Weight {
|
|
(25_805_000 as Weight)
|
|
// Standard Error: 18_000
|
|
.saturating_add((28_473_000 as Weight).saturating_mul(p as Weight))
|
|
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
|
.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(p as Weight)))
|
|
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
|
.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(p as Weight)))
|
|
}
|
|
}
|