mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-05 13:17:26 +00:00
Add WeightInfo to all pallets with benchmarks. (#6575)
* Start adding weight info * More weightinfo * finish weight info * more fixes * inital update of node runtime * fix the rest of the compilation * update balances * add docs * fix balances tests * Fix more tests * Fix compile * Fix pallet-evm tests
This commit is contained in:
@@ -43,7 +43,7 @@ use frame_support::{
|
||||
decl_module, decl_event, decl_error, decl_storage, Parameter, ensure, traits::{
|
||||
Get, ReservableCurrency, Currency, InstanceFilter,
|
||||
OriginTrait, IsType,
|
||||
}, weights::{GetDispatchInfo, constants::{WEIGHT_PER_MICROS, WEIGHT_PER_NANOS}},
|
||||
}, weights::{Weight, GetDispatchInfo, constants::{WEIGHT_PER_MICROS, WEIGHT_PER_NANOS}},
|
||||
dispatch::{PostDispatchInfo, IsSubType},
|
||||
};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
@@ -53,6 +53,24 @@ mod benchmarking;
|
||||
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn proxy(p: u32, ) -> Weight;
|
||||
fn add_proxy(p: u32, ) -> Weight;
|
||||
fn remove_proxy(p: u32, ) -> Weight;
|
||||
fn remove_proxies(p: u32, ) -> Weight;
|
||||
fn anonymous(p: u32, ) -> Weight;
|
||||
fn kill_anonymous(p: u32, ) -> Weight;
|
||||
}
|
||||
|
||||
impl WeightInfo for () {
|
||||
fn proxy(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn add_proxy(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn remove_proxy(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn remove_proxies(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn anonymous(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn kill_anonymous(_p: u32, ) -> Weight { 1_000_000_000 }
|
||||
}
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: frame_system::Trait {
|
||||
/// The overarching event type.
|
||||
@@ -87,6 +105,9 @@ pub trait Trait: frame_system::Trait {
|
||||
|
||||
/// The maximum amount of proxies allowed for a single account.
|
||||
type MaxProxies: Get<u16>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
|
||||
Reference in New Issue
Block a user