mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 21:21:11 +00:00
Fix staking bug (#5170)
* fix staking bug * add some guarantee note in SessionManager while it is not fixed in staking * bumpd impl version
This commit is contained in:
@@ -156,6 +156,8 @@ pub trait SessionManager<ValidatorId> {
|
||||
/// `new_index` is strictly greater than from previous call.
|
||||
///
|
||||
/// The first session start at index 0.
|
||||
///
|
||||
/// `new_session(session)` is guaranteed to be called before `end_session(session-1)`.
|
||||
fn new_session(new_index: SessionIndex) -> Option<Vec<ValidatorId>>;
|
||||
/// End the session.
|
||||
///
|
||||
|
||||
@@ -1659,17 +1659,12 @@ impl<T: Trait> Module<T> {
|
||||
/// End a session potentially ending an era.
|
||||
fn end_session(session_index: SessionIndex) {
|
||||
if let Some(active_era) = Self::active_era() {
|
||||
let next_active_era_start_session_index =
|
||||
if let Some(next_active_era_start_session_index) =
|
||||
Self::eras_start_session_index(active_era.index + 1)
|
||||
.unwrap_or_else(|| {
|
||||
frame_support::print(
|
||||
"Error: start_session_index must be set for active_era + 1"
|
||||
);
|
||||
0
|
||||
});
|
||||
|
||||
if next_active_era_start_session_index == session_index + 1 {
|
||||
Self::end_era(active_era, session_index);
|
||||
{
|
||||
if next_active_era_start_session_index == session_index + 1 {
|
||||
Self::end_era(active_era, session_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user