Rewards and slashing, early-exit of bad sessions (#234)

* Recompile runtime.

* Introduce and enforce block time

* Introduce early session ending.

* Report most of staking module

* rewards, proper early exit and slashing

* Fix build & session logic, introduce tests

* Fixed staking tests.

* Initial test for reward

* Fix test

* Tests for slashing

* Update/fix preset configs

* Fix some tests.

* Fix some staking tests

* Minor fix

* minor cleanups

* Fix build

* Rename timestamp::Value -> Moment

* Require final block of session to be timely
This commit is contained in:
Gav Wood
2018-06-28 16:41:11 +02:00
committed by GitHub
parent 6353f8496b
commit de8dedd878
7 changed files with 45 additions and 20 deletions
+4 -2
View File
@@ -126,8 +126,8 @@ impl consensus::Trait for Concrete {
pub type Consensus = consensus::Module<Concrete>;
impl timestamp::Trait for Concrete {
const SET_POSITION: u32 = TIMESTAMP_SET_POSITION;
type Value = u64;
const TIMESTAMP_SET_POSITION: u32 = TIMESTAMP_SET_POSITION;
type Moment = u64;
}
/// Timestamp module for this concrete runtime.
pub type Timestamp = timestamp::Module<Concrete>;
@@ -142,6 +142,7 @@ impl Convert<AccountId, SessionKey> for SessionKeyConversion {
impl session::Trait for Concrete {
type ConvertAccountIdToSessionKey = SessionKeyConversion;
type OnSessionChange = Staking;
}
/// Session module for this concrete runtime.
pub type Session = session::Module<Concrete>;
@@ -213,6 +214,7 @@ impl_outer_config! {
StakingConfig => staking,
DemocracyConfig => democracy,
CouncilConfig => council,
TimestampConfig => timestamp,
ParachainsConfig => parachains,
}
}