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:
Shawn Tabrizi
2020-07-08 18:22:01 +02:00
committed by GitHub
parent 94cddee160
commit 2302898b8a
65 changed files with 632 additions and 7 deletions
+13
View File
@@ -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! {