From 28e0d3376cb23f7b85f9dda4002947cd0aa44a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Pestana?= Date: Thu, 5 Dec 2024 13:12:46 +0100 Subject: [PATCH] nits --- .../frame/election-provider-multi-phase/src/unsigned.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/substrate/frame/election-provider-multi-phase/src/unsigned.rs b/substrate/frame/election-provider-multi-phase/src/unsigned.rs index 11ad18208332..6c2d55cac3de 100644 --- a/substrate/frame/election-provider-multi-phase/src/unsigned.rs +++ b/substrate/frame/election-provider-multi-phase/src/unsigned.rs @@ -505,7 +505,7 @@ impl Miner { 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)?; @@ -563,7 +563,7 @@ impl Miner { }) .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); @@ -583,6 +583,7 @@ impl Miner { expected_ok.is_ok() }); + // convert back. assignment_staked_to_ratio_normalized(staked)? };