Skip to content

Commit

Permalink
Merge branch 'brent/pos-redelegation' (#1612)
Browse files Browse the repository at this point in the history
* brent/pos-redelegation:
  process_slashes: fix critical bug
  • Loading branch information
brentstone committed Oct 19, 2023
2 parents 7eaf2f3 + 2e58240 commit 37798a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4591,9 +4591,7 @@ where
// `updatedSlashedAmountMap`
let validator_slashes =
slashed_amount_map.entry(validator.clone()).or_default();
for (epoch, slash) in result_slash {
*validator_slashes.entry(epoch).or_default() += slash;
}
*validator_slashes = result_slash;

// `outgoingRedelegation`
let outgoing_redelegations =
Expand Down
4 changes: 1 addition & 3 deletions proof_of_stake/src/tests/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3939,9 +3939,7 @@ impl AbstractPosState {
// `updatedSlashedAmountMap`
let validator_slashes =
val_slash_amounts.entry(validator.clone()).or_default();
for (epoch, slash) in result_slash {
*validator_slashes.entry(epoch).or_default() += slash;
}
*validator_slashes = result_slash;

let dest_validators = self
.outgoing_redelegations
Expand Down

0 comments on commit 37798a8

Please sign in to comment.