Unverified Commit 465e3580 authored by RK's avatar RK Committed by GitHub
Browse files

Companion for #7536 (Pallet Treasury Refactor) (#2025)



* wk2048 | D6 | issue-7143-treasury-refactor | integration

* wk2048 | D6 | issue-7143-treasury-refactor | integration | p2

* trait -> config

* fix weight files and import

* missed some

* fix import

* fix imports

* alphabetize

* fix config traits

* fix trait

* update traits

* update weights

* "Update Substrate"

* fix features

* Update runtime/kusama/src/lib.rs

* Update runtime/polkadot/src/lib.rs

* add bounties and tips in proxy filters

* remove unused

* remove unused

* remove unused
Co-authored-by: Shawn Tabrizi's avatarShawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
Co-authored-by: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>
parent b6f01613
Pipeline #117333 failed with stages
in 28 minutes and 48 seconds
This diff is collapsed.
...@@ -245,6 +245,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene ...@@ -245,6 +245,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
vesting: vec![], vesting: vec![],
}), }),
pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![] }), pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![] }),
pallet_treasury: Some(Default::default()),
} }
} }
...@@ -627,6 +628,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC ...@@ -627,6 +628,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
vesting: vec![], vesting: vec![],
}), }),
pallet_vesting: Some(kusama::VestingConfig { vesting: vec![] }), pallet_vesting: Some(kusama::VestingConfig { vesting: vec![] }),
pallet_treasury: Some(Default::default()),
} }
} }
...@@ -1083,6 +1085,7 @@ pub fn polkadot_testnet_genesis( ...@@ -1083,6 +1085,7 @@ pub fn polkadot_testnet_genesis(
vesting: vec![], vesting: vec![],
}), }),
pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![] }), pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![] }),
pallet_treasury: Some(Default::default()),
} }
} }
...@@ -1177,6 +1180,7 @@ pub fn kusama_testnet_genesis( ...@@ -1177,6 +1180,7 @@ pub fn kusama_testnet_genesis(
vesting: vec![], vesting: vec![],
}), }),
pallet_vesting: Some(kusama::VestingConfig { vesting: vec![] }), pallet_vesting: Some(kusama::VestingConfig { vesting: vec![] }),
pallet_treasury: Some(Default::default()),
} }
} }
......
...@@ -573,13 +573,12 @@ mod tests { ...@@ -573,13 +573,12 @@ mod tests {
impl_outer_origin, assert_ok, assert_noop, parameter_types, impl_outer_origin, assert_ok, assert_noop, parameter_types,
traits::{OnInitialize, OnFinalize}, traits::{OnInitialize, OnFinalize},
}; };
use frame_support::traits::{Contains, ContainsLengthBound};
use sp_core::H256; use sp_core::H256;
use primitives::v1::{Id as ParaId, ValidationCode}; use primitives::v1::{Id as ParaId, ValidationCode};
// The testing primitives are very useful for avoiding having to work with signatures // The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried. // or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sp_runtime::{ use sp_runtime::{
Permill, Percent, testing::Header, DispatchResult, Permill, testing::Header, DispatchResult,
traits::{BlakeTwo256, IdentityLookup}, traits::{BlakeTwo256, IdentityLookup},
}; };
use crate::slots::Registrar; use crate::slots::Registrar;
...@@ -638,28 +637,7 @@ mod tests { ...@@ -638,28 +637,7 @@ mod tests {
pub const ProposalBondMinimum: u64 = 1; pub const ProposalBondMinimum: u64 = 1;
pub const SpendPeriod: u64 = 2; pub const SpendPeriod: u64 = 2;
pub const Burn: Permill = Permill::from_percent(50); pub const Burn: Permill = Permill::from_percent(50);
pub const TipCountdown: u64 = 1;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: u64 = 1;
pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry"); pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");
pub const DataDepositPerByte: u64 = 1;
pub const BountyDepositBase: u64 = 1;
pub const BountyDepositPayoutDelay: u64 = 1;
pub const BountyUpdatePeriod: u64 = 1;
pub const MaximumReasonLength: u32 = 16384;
pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);
pub const BountyValueMinimum: u64 = 1;
}
pub struct Nobody;
impl Contains<u64> for Nobody {
fn contains(_: &u64) -> bool { false }
fn sorted_members() -> Vec<u64> { vec![] }
#[cfg(feature = "runtime-benchmarks")]
fn add(_: &u64) { unimplemented!() }
}
impl ContainsLengthBound for Nobody {
fn min_len() -> usize { 0 }
fn max_len() -> usize { 0 }
} }
impl pallet_treasury::Config for Test { impl pallet_treasury::Config for Test {
type Currency = pallet_balances::Module<Test>; type Currency = pallet_balances::Module<Test>;
...@@ -672,18 +650,8 @@ mod tests { ...@@ -672,18 +650,8 @@ mod tests {
type SpendPeriod = SpendPeriod; type SpendPeriod = SpendPeriod;
type Burn = Burn; type Burn = Burn;
type BurnDestination = (); type BurnDestination = ();
type Tippers = Nobody;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type DataDepositPerByte = DataDepositPerByte;
type BountyDepositBase = BountyDepositBase;
type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
type BountyUpdatePeriod = BountyUpdatePeriod;
type MaximumReasonLength = MaximumReasonLength;
type BountyCuratorDeposit = BountyCuratorDeposit;
type BountyValueMinimum = BountyValueMinimum;
type ModuleId = TreasuryModuleId; type ModuleId = TreasuryModuleId;
type SpendFunds = ();
type WeightInfo = (); type WeightInfo = ();
} }
......
...@@ -138,18 +138,6 @@ mod tests { ...@@ -138,18 +138,6 @@ mod tests {
type WeightInfo = (); type WeightInfo = ();
} }
pub struct Nobody;
impl frame_support::traits::Contains<AccountId> for Nobody {
fn contains(_: &AccountId) -> bool { false }
fn sorted_members() -> Vec<AccountId> { vec![] }
#[cfg(feature = "runtime-benchmarks")]
fn add(_: &AccountId) { unimplemented!() }
}
impl frame_support::traits::ContainsLengthBound for Nobody {
fn min_len() -> usize { 0 }
fn max_len() -> usize { 0 }
}
parameter_types! { parameter_types! {
pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry"); pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");
} }
...@@ -165,18 +153,8 @@ mod tests { ...@@ -165,18 +153,8 @@ mod tests {
type SpendPeriod = (); type SpendPeriod = ();
type Burn = (); type Burn = ();
type BurnDestination = (); type BurnDestination = ();
type Tippers = Nobody;
type TipCountdown = ();
type TipFindersFee = ();
type TipReportDepositBase = ();
type DataDepositPerByte = ();
type BountyDepositBase = ();
type BountyDepositPayoutDelay = ();
type BountyUpdatePeriod = ();
type MaximumReasonLength = ();
type BountyCuratorDeposit = ();
type BountyValueMinimum = ();
type ModuleId = TreasuryModuleId; type ModuleId = TreasuryModuleId;
type SpendFunds = ();
type WeightInfo = (); type WeightInfo = ();
} }
......
...@@ -34,6 +34,7 @@ pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", ...@@ -34,6 +34,7 @@ pallet-authority-discovery = { git = "https://github.com/paritytech/substrate",
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
...@@ -60,6 +61,7 @@ pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = " ...@@ -60,6 +61,7 @@ pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
...@@ -107,6 +109,7 @@ std = [ ...@@ -107,6 +109,7 @@ std = [
"frame-support/std", "frame-support/std",
"pallet-authorship/std", "pallet-authorship/std",
"pallet-balances/std", "pallet-balances/std",
"pallet-bounties/std",
"pallet-transaction-payment/std", "pallet-transaction-payment/std",
"pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment-rpc-runtime-api/std",
"pallet-collective/std", "pallet-collective/std",
...@@ -132,6 +135,7 @@ std = [ ...@@ -132,6 +135,7 @@ std = [
"frame-system/std", "frame-system/std",
"frame-system-rpc-runtime-api/std", "frame-system-rpc-runtime-api/std",
"pallet-timestamp/std", "pallet-timestamp/std",
"pallet-tips/std",
"pallet-treasury/std", "pallet-treasury/std",
"sp-version/std", "sp-version/std",
"pallet-utility/std", "pallet-utility/std",
...@@ -153,6 +157,7 @@ runtime-benchmarks = [ ...@@ -153,6 +157,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks", "sp-runtime/runtime-benchmarks",
"pallet-babe/runtime-benchmarks", "pallet-babe/runtime-benchmarks",
"pallet-balances/runtime-benchmarks", "pallet-balances/runtime-benchmarks",
"pallet-bounties/runtime-benchmarks",
"pallet-collective/runtime-benchmarks", "pallet-collective/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks", "pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks",
...@@ -166,6 +171,7 @@ runtime-benchmarks = [ ...@@ -166,6 +171,7 @@ runtime-benchmarks = [
"pallet-society/runtime-benchmarks", "pallet-society/runtime-benchmarks",
"pallet-staking/runtime-benchmarks", "pallet-staking/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks",
"pallet-tips/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks", "pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks", "pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks", "pallet-vesting/runtime-benchmarks",
......
...@@ -559,25 +559,39 @@ impl pallet_treasury::Config for Runtime { ...@@ -559,25 +559,39 @@ impl pallet_treasury::Config for Runtime {
type Currency = Balances; type Currency = Balances;
type ApproveOrigin = ApproveOrigin; type ApproveOrigin = ApproveOrigin;
type RejectOrigin = MoreThanHalfCouncil; type RejectOrigin = MoreThanHalfCouncil;
type Tippers = ElectionsPhragmen;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type DataDepositPerByte = DataDepositPerByte;
type Event = Event; type Event = Event;
type OnSlash = Treasury; type OnSlash = Treasury;
type ProposalBond = ProposalBond; type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum; type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod; type SpendPeriod = SpendPeriod;
type Burn = Burn; type Burn = Burn;
type BurnDestination = Society;
type SpendFunds = Bounties;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
}
impl pallet_bounties::Config for Runtime {
type Event = Event;
type BountyDepositBase = BountyDepositBase; type BountyDepositBase = BountyDepositBase;
type BountyDepositPayoutDelay = BountyDepositPayoutDelay; type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
type BountyUpdatePeriod = BountyUpdatePeriod; type BountyUpdatePeriod = BountyUpdatePeriod;
type MaximumReasonLength = MaximumReasonLength;
type BountyCuratorDeposit = BountyCuratorDeposit; type BountyCuratorDeposit = BountyCuratorDeposit;
type BountyValueMinimum = BountyValueMinimum; type BountyValueMinimum = BountyValueMinimum;
type BurnDestination = Society; type DataDepositPerByte = DataDepositPerByte;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>; type MaximumReasonLength = MaximumReasonLength;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}
impl pallet_tips::Config for Runtime {
type Event = Event;
type DataDepositPerByte = DataDepositPerByte;
type MaximumReasonLength = MaximumReasonLength;
type Tippers = ElectionsPhragmen;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type WeightInfo = weights::pallet_tips::WeightInfo<Runtime>;
} }
parameter_types! { parameter_types! {
...@@ -850,6 +864,8 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -850,6 +864,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::ElectionsPhragmen(..) | Call::ElectionsPhragmen(..) |
Call::TechnicalMembership(..) | Call::TechnicalMembership(..) |
Call::Treasury(..) | Call::Treasury(..) |
Call::Bounties(..) |
Call::Tips(..) |
Call::Claims(..) | Call::Claims(..) |
Call::Utility(..) | Call::Utility(..) |
Call::Identity(..) | Call::Identity(..) |
...@@ -874,6 +890,8 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -874,6 +890,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::TechnicalCommittee(..) | Call::TechnicalCommittee(..) |
Call::ElectionsPhragmen(..) | Call::ElectionsPhragmen(..) |
Call::Treasury(..) | Call::Treasury(..) |
Call::Bounties(..) |
Call::Tips(..) |
Call::Utility(..) Call::Utility(..)
), ),
ProxyType::Staking => matches!(c, ProxyType::Staking => matches!(c,
...@@ -1185,7 +1203,7 @@ construct_runtime! { ...@@ -1185,7 +1203,7 @@ construct_runtime! {
TechnicalCommittee: pallet_collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>} = 15, TechnicalCommittee: pallet_collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>} = 15,
ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>} = 16, ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>} = 16,
TechnicalMembership: pallet_membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>} = 17, TechnicalMembership: pallet_membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>} = 17,
Treasury: pallet_treasury::{Module, Call, Storage, Event<T>} = 18, Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>} = 18,
// Claims. Usable initially. // Claims. Usable initially.
Claims: claims::{Module, Call, Storage, Event<T>, Config<T>, ValidateUnsigned} = 19, Claims: claims::{Module, Call, Storage, Event<T>, Config<T>, ValidateUnsigned} = 19,
...@@ -1213,6 +1231,12 @@ construct_runtime! { ...@@ -1213,6 +1231,12 @@ construct_runtime! {
// Multisig module. Late addition. // Multisig module. Late addition.
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>} = 31, Multisig: pallet_multisig::{Module, Call, Storage, Event<T>} = 31,
// Bounties module.
Bounties: pallet_bounties::{Module, Call, Storage, Event<T>} = 35,
// Tips module.
Tips: pallet_tips::{Module, Call, Storage, Event<T>} = 36,
} }
} }
...@@ -1528,6 +1552,7 @@ sp_api::impl_runtime_apis! { ...@@ -1528,6 +1552,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, claims, Claims); add_benchmark!(params, batches, claims, Claims);
// Substrate // Substrate
add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_bounties, Bounties);
add_benchmark!(params, batches, pallet_collective, Council); add_benchmark!(params, batches, pallet_collective, Council);
add_benchmark!(params, batches, pallet_democracy, Democracy); add_benchmark!(params, batches, pallet_democracy, Democracy);
add_benchmark!(params, batches, pallet_elections_phragmen, ElectionsPhragmen); add_benchmark!(params, batches, pallet_elections_phragmen, ElectionsPhragmen);
...@@ -1542,6 +1567,7 @@ sp_api::impl_runtime_apis! { ...@@ -1542,6 +1567,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_staking, Staking); add_benchmark!(params, batches, pallet_staking, Staking);
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>); add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_tips, Tips);
add_benchmark!(params, batches, pallet_treasury, Treasury); add_benchmark!(params, batches, pallet_treasury, Treasury);
add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, pallet_vesting, Vesting); add_benchmark!(params, batches, pallet_vesting, Vesting);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
pub mod frame_system; pub mod frame_system;
pub mod pallet_balances; pub mod pallet_balances;
pub mod pallet_bounties;
pub mod pallet_collective; pub mod pallet_collective;
pub mod pallet_democracy; pub mod pallet_democracy;
pub mod pallet_elections_phragmen; pub mod pallet_elections_phragmen;
...@@ -29,6 +30,7 @@ pub mod pallet_scheduler; ...@@ -29,6 +30,7 @@ pub mod pallet_scheduler;
pub mod pallet_session; pub mod pallet_session;
pub mod pallet_staking; pub mod pallet_staking;
pub mod pallet_timestamp; pub mod pallet_timestamp;
pub mod pallet_tips;
pub mod pallet_treasury; pub mod pallet_treasury;
pub mod pallet_utility; pub mod pallet_utility;
pub mod pallet_vesting; pub mod pallet_vesting;
// 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.
//! Autogenerated weights for pallet_bounties
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
//! DATE: 2020-11-20, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128
// Executed Command:
// target/release/substrate
// benchmark
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_bounties
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/bounties/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weights for pallet_bounties using the Substrate node and recommended hardware.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bounties::WeightInfo for WeightInfo<T> {
fn propose_bounty(d: u32, ) -> Weight {
(64_778_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(d as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn approve_bounty() -> Weight {
(18_293_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn propose_curator() -> Weight {
(14_248_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn unassign_curator() -> Weight {
(52_100_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn accept_curator() -> Weight {
(52_564_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn award_bounty() -> Weight {
(37_426_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn claim_bounty() -> Weight {
(176_077_000 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 {
(51_162_000 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 {
(116_907_000 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 {
(36_419_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn spend_funds(b: u32, ) -> Weight {
(7_562_000 as Weight)
// Standard Error: 16_000
.saturating_add((77_328_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
}
}
// 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.
//! Autogenerated weights for pallet_tips
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
//! DATE: 2020-11-20, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128
// Executed Command:
// target/release/substrate
// benchmark
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_tips
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/tips/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weights for pallet_tips using the Substrate node and recommended hardware.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_tips::WeightInfo for WeightInfo<T> {
fn report_awesome(r: u32, ) -> Weight {
(70_338_000 as Weight)
.saturating_add((2_000 as Weight).saturating_mul(r as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn retract_tip() -> Weight {