srml: staking: track session index of current era start (#3203)

* srml: staking: track session index of current era start

* node: bump spec_version
This commit is contained in:
André Silva
2019-07-25 13:22:46 +01:00
committed by Bastian Köcher
parent 002acb9373
commit b633f93b00
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -590,6 +590,9 @@ decl_storage! {
/// The start of the current era.
pub CurrentEraStart get(current_era_start): MomentOf<T>;
/// The session index at which the current era started.
pub CurrentEraStartSessionIndex get(current_era_start_session_index): SessionIndex;
/// Rewards for the current era. Using indices of current elected set.
pub CurrentEraRewards: EraRewards;
@@ -1169,6 +1172,9 @@ impl<T: Trait> Module<T> {
// Increment current era.
let current_era = CurrentEra::mutate(|s| { *s += 1; *s });
CurrentEraStartSessionIndex::mutate(|v| {
*v = start_session_index;
});
let bonding_duration = T::BondingDuration::get();
if current_era > bonding_duration {