prospective-parachains: respond with multiple backable candidates (#3160)

Fixes https://github.com/paritytech/polkadot-sdk/issues/3129
This commit is contained in:
Alin Dima
2024-02-06 10:21:28 +02:00
committed by GitHub
parent 53f615de50
commit 7df1ae3b81
9 changed files with 844 additions and 92 deletions
+12 -7
View File
@@ -373,13 +373,18 @@ mod select_candidates {
let _ = sender.send(response);
},
AllMessages::ProspectiveParachains(
ProspectiveParachainsMessage::GetBackableCandidate(.., tx),
) => match prospective_parachains_mode {
ProspectiveParachainsMode::Enabled { .. } => {
let _ = tx.send(candidates_iter.next());
},
ProspectiveParachainsMode::Disabled =>
panic!("unexpected prospective parachains request"),
ProspectiveParachainsMessage::GetBackableCandidates(_, _, count, _, tx),
) => {
assert_eq!(count, 1);
match prospective_parachains_mode {
ProspectiveParachainsMode::Enabled { .. } => {
let _ =
tx.send(candidates_iter.next().map_or_else(Vec::new, |c| vec![c]));
},
ProspectiveParachainsMode::Disabled =>
panic!("unexpected prospective parachains request"),
}
},
_ => panic!("Unexpected message: {:?}", from_job),
}