Skip to content

Commit

Permalink
remove non-candidate from next session check
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Aug 23, 2024
1 parent 9384ddd commit 62c1d85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pallets/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,11 @@ pub mod pallet {
let (locked_until, _) = NonCandidates::<T>::get(&who);
if T::ValidatorSet::session_index() > locked_until {
// bond is already unlocked
continue;
<LastAuthoredBlock<T>>::remove(who);
} else {
// slash un-bonding candidate
Self::slash_non_candidate(&who);
}
// slash un-bonding candidate
Self::slash_non_candidate(&who);
}
}
(
Expand Down
2 changes: 1 addition & 1 deletion pallets/collator-selection/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ fn should_not_slash_unbonding_candidates() {

initialize_to_block(20);
assert_eq!(SessionChangeBlock::get(), 20);
assert_eq!(LastAuthoredBlock::<Test>::get(3), 10);
assert!(!LastAuthoredBlock::<Test>::contains_key(3));
assert_eq!(LastAuthoredBlock::<Test>::get(4), 20);

assert_eq!(NonCandidates::<Test>::get(3), (1, 10));
Expand Down

0 comments on commit 62c1d85

Please sign in to comment.