Skip to content

Commit

Permalink
modify more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
girazoki committed Jan 8, 2025
1 parent 2db810f commit 803cb10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pallets/external-validator-slashes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub mod pallet {

// If we defer duration is 0, we immediately apply and confirm
let era_to_consider = if slash_defer_duration == 0 {
era
era.saturating_add(One::one())
} else {
era.saturating_add(slash_defer_duration)
.saturating_add(One::one())
Expand Down
3 changes: 2 additions & 1 deletion pallets/external-validator-slashes/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ fn defer_period_of_zero_confirms_immediately_slashes() {
1u64,
Perbill::from_percent(75)
));
let era_to_slash = 1;
assert_eq!(
Slashes::<Test>::get(0),
Slashes::<Test>::get(era_to_slash),
vec![Slash {
validator: 1,
percentage: Perbill::from_percent(75),
Expand Down

0 comments on commit 803cb10

Please sign in to comment.