Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
gpestana committed Dec 5, 2024
1 parent fe70f16 commit 28e0d33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions substrate/frame/election-provider-multi-phase/src/unsigned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ impl<T: MinerConfig> Miner<T> {
let mut edges_trimmed = 0;

// Reduce (requires round-trip to staked form) and ensures the max backer per winner bound
// requirements are met.
// requirements are met.
let sorted_assignments = {
// convert to staked and reduce.
let mut staked = assignment_ratio_to_staked_normalized(assignments, &stake_of)?;
Expand Down Expand Up @@ -563,7 +563,7 @@ impl<T: MinerConfig> Miner<T> {
})
.collect();

// remove dropped edge from assignments.
// remove lowest stake edges calculated above from assignments.
staked.iter_mut().for_each(|assignment| {
if filtered.contains(&assignment.who) {
assignment.distribution.retain(|(t, _)| t != target);
Expand All @@ -583,6 +583,7 @@ impl<T: MinerConfig> Miner<T> {
expected_ok.is_ok()
});

// convert back.
assignment_staked_to_ratio_normalized(staked)?
};

Expand Down

0 comments on commit 28e0d33

Please sign in to comment.