Skip to content

Commit

Permalink
fixup!: don't call process_slashes within advance_epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone authored and Fraccaman committed Jun 5, 2023
1 parent 6390e2a commit 0b4782a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions proof_of_stake/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ fn test_slashes_with_unbonding_aux(
s.commit_block().unwrap();

current_epoch = advance_epoch(&mut s, &params);
super::process_slashes(&mut s, current_epoch).unwrap();

// Discover first slash
let slash_0_evidence_epoch = current_epoch;
Expand All @@ -946,6 +947,7 @@ fn test_slashes_with_unbonding_aux(
slash_0_evidence_epoch + params.slash_processing_epoch_offset();
while current_epoch < unfreeze_epoch {
current_epoch = advance_epoch(&mut s, &params);
super::process_slashes(&mut s, current_epoch).unwrap();
}

// Advance more epochs randomly from the generated delay
Expand Down Expand Up @@ -981,6 +983,7 @@ fn test_slashes_with_unbonding_aux(
let withdraw_epoch = unbond_epoch + params.withdrawable_epoch_offset();
while current_epoch < withdraw_epoch {
current_epoch = advance_epoch(&mut s, &params);
super::process_slashes(&mut s, current_epoch).unwrap();
}
let token = staking_token_address(&s);
let val_balance_pre = read_balance(&s, &token, val_addr).unwrap();
Expand Down Expand Up @@ -1905,8 +1908,8 @@ fn advance_epoch(s: &mut TestWlStorage, params: &PosParams) -> Epoch {
&below_capacity_validator_set_handle(),
)
.unwrap();
process_slashes(s, current_epoch).unwrap();
dbg!(current_epoch);
// process_slashes(s, current_epoch).unwrap();
// dbg!(current_epoch);
current_epoch
}

Expand Down

0 comments on commit 0b4782a

Please sign in to comment.