mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 11:41:02 +00:00
Dispute Coordinator: Batch queries (#3459)
* disputes: Allow batch queries in dispute-coordinator This commit moves to batch queries when responding to QueryCandidateVotes messages. This simplifies the code in the provisioner and dispute-coordinator by no longer requiring to make use of a FuturesOrdered when awaiting multiple quries. Instead, the provisioner need only request the batch itself. * node/approval-voting: Address Feedback to fail on query element missing. * Address feedback * Fix implementer's guide
This commit is contained in:
@@ -352,11 +352,12 @@ async fn get_candidate_votes<Context: SubsystemContext>(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx.send_message(AllMessages::DisputeCoordinator(
|
||||
DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
session_index,
|
||||
candidate_hash,
|
||||
vec![(session_index, candidate_hash)],
|
||||
tx
|
||||
)
|
||||
))
|
||||
.await;
|
||||
rx.await.map_err(|_| NonFatal::AskCandidateVotesCanceled)
|
||||
rx.await
|
||||
.map(|v| v.get(0).map(|inner| inner.to_owned().2))
|
||||
.map_err(|_| NonFatal::AskCandidateVotesCanceled)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user