mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 06:21:11 +00:00
dispute-coordinator: Cleanup + Bug fixes (#5323)
* Make import confirmation oneshot optional. * Cleanup for further improvements. * Queue adoptions. * Fix fieldname * Use correct relay parent * Fix scraper tests. * Small optimization. * Fix all tests. * Fix other tests. * fmt * spelling * Fix warning.
This commit is contained in:
@@ -887,16 +887,13 @@ impl CandidateBackingJob {
|
||||
if let (Some(candidate_receipt), Some(dispute_statement)) =
|
||||
(maybe_candidate_receipt, maybe_signed_dispute_statement)
|
||||
{
|
||||
// TODO: Log confirmation results in an efficient way:
|
||||
// https://github.com/paritytech/polkadot/issues/5156
|
||||
let (pending_confirmation, _confirmation_rx) = oneshot::channel();
|
||||
sender
|
||||
.send_message(DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt,
|
||||
session: self.session_index,
|
||||
statements: vec![(dispute_statement, validator_index)],
|
||||
pending_confirmation,
|
||||
pending_confirmation: None,
|
||||
})
|
||||
.await;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ use polkadot_primitives::v2::{
|
||||
ScheduledCore,
|
||||
};
|
||||
use polkadot_subsystem::{
|
||||
messages::{
|
||||
CollatorProtocolMessage, ImportStatementsResult, RuntimeApiMessage, RuntimeApiRequest,
|
||||
},
|
||||
messages::{CollatorProtocolMessage, RuntimeApiMessage, RuntimeApiRequest},
|
||||
ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal,
|
||||
};
|
||||
use sp_application_crypto::AppKey;
|
||||
@@ -284,7 +282,7 @@ async fn test_dispute_coordinator_notifications(
|
||||
candidate_receipt: c_receipt,
|
||||
session: s,
|
||||
statements,
|
||||
pending_confirmation,
|
||||
pending_confirmation: None,
|
||||
}
|
||||
) => {
|
||||
assert_eq!(c_hash, candidate_hash);
|
||||
@@ -292,7 +290,6 @@ async fn test_dispute_coordinator_notifications(
|
||||
assert_eq!(s, session);
|
||||
assert_eq!(statements.len(), 1);
|
||||
assert_eq!(statements[0].1, validator_index);
|
||||
let _ = pending_confirmation.send(ImportStatementsResult::ValidImport);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user