mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 16:37:57 +00:00
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:
committed by
Bastian Köcher
parent
002acb9373
commit
b633f93b00
@@ -79,8 +79,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
// and set impl_version to equal spec_version. If only runtime
|
||||
// implementation changes and behavior does not, then leave spec_version as
|
||||
// is and increment impl_version.
|
||||
spec_version: 120,
|
||||
impl_version: 120,
|
||||
spec_version: 121,
|
||||
impl_version: 121,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user