Force new era only if 1/3 validators is disabled. (#3533)

* Force new era only when over third validators is disabled.

* Update srml/session/src/lib.rs

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

* Update srml/staking/src/lib.rs

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

* Parametrize the threshold.

* Bump runtime version.

* Update node/runtime/src/lib.rs

* Fix build.

* Fix im-online test.
This commit is contained in:
Tomasz Drwięga
2019-09-19 12:04:48 +02:00
committed by Gavin Wood
parent bfe240d1b0
commit 668acca9ed
7 changed files with 95 additions and 12 deletions
+5
View File
@@ -183,6 +183,10 @@ impl timestamp::Trait for Test {
type MinimumPeriod = MinimumPeriod;
}
parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
}
impl Trait for Test {
type ShouldEndSession = TestShouldEndSession;
#[cfg(feature = "historical")]
@@ -195,6 +199,7 @@ impl Trait for Test {
type Keys = MockSessionKeys;
type Event = ();
type SelectInitialValidators = ();
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
}
#[cfg(feature = "historical")]