Fix tracking validator set in ImOnline (#3596)

* Use session::validators instead of staking::current_elected

* Basic test framework.

* Initialize validators, attempt to heartbeat.

* Use dummy crypto for im-online testing.

* Remove printlns.

* Finish test, make it invalid.

* Add reporting test.

* Finalize the test.

* Remove dumbness.

* Updates.

* Update AuRa

* Update srml/im-online/src/tests.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Derive Ord

* Add some more tests.

* Remove stray todo.

* Bump runtime version.

* Bump impl-trait-for-tuples.

* Enforce new version of trait-for-tuples.
This commit is contained in:
Tomasz Drwięga
2019-09-13 14:55:33 +02:00
committed by Gavin Wood
parent a7f35680b4
commit b7c6bc1ed5
26 changed files with 493 additions and 133 deletions
@@ -17,16 +17,7 @@
//! A crate which contains primitives that are useful for implementation that uses staking
//! approaches in general. Definitions related to sessions, slashing, etc go here.
use rstd::vec::Vec;
pub mod offence;
/// Simple index type with which we can count sessions.
pub type SessionIndex = u32;
/// A trait for getting the currently elected validator set without coupling to the module that
/// provides this information.
pub trait CurrentElectedSet<ValidatorId> {
/// Returns the validator ids for the currently elected validator set.
fn current_elected_set() -> Vec<ValidatorId>;
}