Benchmarks for offences pallet. (#5851)

* really rough mock runtime

* start to work on offences

* Make sure to start the session.

* Update to latest master.

* Add verify.

* Fix on_initialize benchmark.

* Add grandpa offence.

* Add Babe offence benchmarking.

* Enable babe test.

* Address review grumbles.

* Address review grumbles.

* Address review grumbles part 1/2

* use currency trait

* features

* Check events explicitly.

* Auto-impl tuple converter.

* Removed dead code.

* add test feature flag

* dont use std

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Tomasz Drwięga
2020-05-06 14:27:47 +02:00
committed by GitHub
parent 11f144ee65
commit 66c02fe651
8 changed files with 558 additions and 76 deletions
+6
View File
@@ -2895,6 +2895,12 @@ impl<T: Trait> Module<T> {
pub fn put_election_status(status: ElectionStatus::<T::BlockNumber>) {
<EraElectionStatus<T>>::put(status);
}
#[cfg(feature = "runtime-benchmarks")]
pub fn set_slash_reward_fraction(fraction: Perbill) {
SlashRewardFraction::put(fraction);
}
}
/// In this implementation `new_session(session)` must be called before `end_session(session-1)`