pallet epm: add TrimmingStatus to the mined solution (#1659)

For tools such that is using the `Miner` it's useful to know whether a
solution was trimmed or not and also how much that was trimmed.

---------

Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
This commit is contained in:
Niklas Adolfsson
2023-09-22 19:22:18 +02:00
committed by GitHub
parent 22d9e2abc6
commit f79fa6c8bd
4 changed files with 73 additions and 36 deletions
@@ -2365,7 +2365,7 @@ mod tests {
assert_eq!(MultiPhase::desired_targets().unwrap(), 2);
// mine seq_phragmen solution with 2 iters.
let (solution, witness) = MultiPhase::mine_solution().unwrap();
let (solution, witness, _) = MultiPhase::mine_solution().unwrap();
// ensure this solution is valid.
assert!(MultiPhase::queued_solution().is_none());
@@ -2647,7 +2647,7 @@ mod tests {
// set the solution balancing to get the desired score.
crate::mock::Balancing::set(Some(BalancingConfig { iterations: 2, tolerance: 0 }));
let (solution, _) = MultiPhase::mine_solution().unwrap();
let (solution, _, _) = MultiPhase::mine_solution().unwrap();
// Default solution's score.
assert!(matches!(solution.score, ElectionScore { minimal_stake: 50, .. }));