mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 02:21:14 +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:
@@ -64,6 +64,32 @@ type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trai
|
||||
/// Just a bunch of bytes, but they should decode to a valid `Call`.
|
||||
pub type OpaqueCall = Vec<u8>;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn as_multi_threshold_1(z: u32, ) -> Weight;
|
||||
fn as_multi_create(s: u32, z: u32, ) -> Weight;
|
||||
fn as_multi_create_store(s: u32, z: u32, ) -> Weight;
|
||||
fn as_multi_approve(s: u32, z: u32, ) -> Weight;
|
||||
fn as_multi_complete(s: u32, z: u32, ) -> Weight;
|
||||
fn approve_as_multi_create(s: u32, z: u32, ) -> Weight;
|
||||
fn approve_as_multi_approve(s: u32, z: u32, ) -> Weight;
|
||||
fn approve_as_multi_complete(s: u32, z: u32, ) -> Weight;
|
||||
fn cancel_as_multi(s: u32, z: u32, ) -> Weight;
|
||||
fn cancel_as_multi_store(s: u32, z: u32, ) -> Weight;
|
||||
}
|
||||
|
||||
impl WeightInfo for () {
|
||||
fn as_multi_threshold_1(_z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn as_multi_create(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn as_multi_create_store(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn as_multi_approve(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn as_multi_complete(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn approve_as_multi_create(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn approve_as_multi_approve(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn approve_as_multi_complete(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn cancel_as_multi(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn cancel_as_multi_store(_s: u32, _z: u32, ) -> Weight { 1_000_000_000 }
|
||||
}
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: frame_system::Trait {
|
||||
/// The overarching event type.
|
||||
@@ -91,6 +117,9 @@ pub trait Trait: frame_system::Trait {
|
||||
|
||||
/// The maximum amount of signatories allowed in the multisig.
|
||||
type MaxSignatories: Get<u16>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
/// A global extrinsic index, formed as the extrinsic index within a block, together with that
|
||||
|
||||
@@ -84,6 +84,7 @@ impl frame_system::Trait for Test {
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = ();
|
||||
}
|
||||
parameter_types! {
|
||||
pub const ExistentialDeposit: u64 = 1;
|
||||
@@ -94,6 +95,7 @@ impl pallet_balances::Trait for Test {
|
||||
type DustRemoval = ();
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = System;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
parameter_types! {
|
||||
pub const DepositBase: u64 = 1;
|
||||
@@ -118,6 +120,7 @@ impl Trait for Test {
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
type System = frame_system::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
|
||||
Reference in New Issue
Block a user