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
@@ -26,8 +26,6 @@ use crate::SessionIndex;
/// The kind of an offence, is a byte string representing some kind identifier
/// e.g. `b"im-online:offlin"`, `b"babe:equivocatio"`
// TODO [slashing]: Is there something better we can have here that is more natural but still
// flexible? as you see in examples, they get cut off with long names.
pub type Kind = [u8; 16];
/// Number of times the offence of this authority was already reported in the past.