mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 06:21:11 +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:
@@ -70,6 +70,16 @@ use sp_runtime::{DispatchError, DispatchResult, traits::Dispatchable};
|
||||
mod tests;
|
||||
mod benchmarking;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn batch(c: u32, ) -> Weight;
|
||||
fn as_derivative(u: u32, ) -> Weight;
|
||||
}
|
||||
|
||||
impl WeightInfo for () {
|
||||
fn batch(_c: u32, ) -> Weight { 1_000_000_000 }
|
||||
fn as_derivative(_u: u32, ) -> Weight { 1_000_000_000 }
|
||||
}
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: frame_system::Trait {
|
||||
/// The overarching event type.
|
||||
@@ -79,6 +89,9 @@ pub trait Trait: frame_system::Trait {
|
||||
type Call: Parameter + Dispatchable<Origin=Self::Origin, PostInfo=PostDispatchInfo>
|
||||
+ GetDispatchInfo + From<frame_system::Call<Self>>
|
||||
+ UnfilteredDispatchable<Origin=Self::Origin>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
|
||||
Reference in New Issue
Block a user