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:
  PoS: comment out unused code
  test/e2e/slashing: fix flakiness
  bench/vps: credit source before bond tx
  make: skip pos_state_machine_test in CI
  • Loading branch information
tzemanovic committed Oct 18, 2023
2 parents 9eb62e9 + c8f3a7d commit c273d0b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3092,14 +3092,14 @@ where
// TODO: apply rewards
let slashes = find_validator_slashes(storage, &bond_id.validator)?;
// dbg!(&slashes);
let slash_rates =
slashes
.iter()
.fold(BTreeMap::<Epoch, Dec>::new(), |mut map, slash| {
let tot_rate = map.entry(slash.epoch).or_default();
*tot_rate = cmp::min(Dec::one(), *tot_rate + slash.rate);
map
});
// let slash_rates =
// slashes
// .iter()
// .fold(BTreeMap::<Epoch, Dec>::new(), |mut map, slash| {
// let tot_rate = map.entry(slash.epoch).or_default();
// *tot_rate = cmp::min(Dec::one(), *tot_rate + slash.rate);
// map
// });
// dbg!(&slash_rates);

// Accumulate incoming redelegations slashes from source validator, if any.
Expand Down

0 comments on commit c273d0b

Please sign in to comment.