Unverified Commit dcaa880c authored by Andronik Ordian's avatar Andronik Ordian Committed by GitHub
Browse files

CI: run disputes tests (#3962)

* CI: run disputes tests

* Revert "minor chore changes (#3944)"

This reverts commit 1d05f779.

* fix em

* Revert "Revert "minor chore changes (#3944)""

This reverts commit 02a1ecf3

.

* Update handle_import_statement function

* fmt

Co-authored-by: Lldenaurois's avatarLldenaurois <Ljdenaurois@gmail.com>
parent a2869fa9
Pipeline #159788 passed with stages
in 50 minutes and 16 seconds
......@@ -38,7 +38,7 @@ use polkadot_node_primitives::{
use polkadot_node_subsystem::{
errors::{ChainApiError, RuntimeApiError},
messages::{
BlockDescription, ChainApiMessage, DisputeCoordinatorMessage, DisputeDistributionMessage,
BlockDescription, DisputeCoordinatorMessage, DisputeDistributionMessage,
DisputeParticipationMessage, ImportStatementsResult,
},
overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError,
......@@ -631,7 +631,6 @@ async fn handle_import_statements(
session: SessionIndex,
statements: Vec<(SignedDisputeStatement, ValidatorIndex)>,
now: Timestamp,
pending_confirmation: oneshot::Sender<ImportStatementsResult>,
metrics: &Metrics,
) -> Result<ImportStatementsResult, Error> {
if state.highest_session.map_or(true, |h| session + DISPUTE_WINDOW < h) {
......@@ -913,7 +912,7 @@ async fn issue_local_statement(
now,
metrics,
)
.await?
.await
{
Err(_) => {
tracing::error!(
......
......@@ -26,9 +26,7 @@ use overseer::TimeoutExt;
use parity_scale_codec::Encode;
use polkadot_node_subsystem::{
jaeger,
messages::{
AllMessages, BlockDescription, ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest,
},
messages::{AllMessages, BlockDescription, RuntimeApiMessage, RuntimeApiRequest},
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus,
};
use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
......@@ -170,33 +168,22 @@ impl TestState {
)))
.await;
self.handle_sync_queries(virtual_overseer, block_hash, block_header, session)
.await;
self.handle_sync_queries(virtual_overseer, block_hash, session).await;
}
async fn handle_sync_queries(
&self,
virtual_overseer: &mut VirtualOverseer,
block_hash: Hash,
block_header: Header,
session: SessionIndex,
) {
assert_matches!(
virtual_overseer.recv().await,
AllMessages::ChainApi(ChainApiMessage::BlockHeader(h, tx)) => {
assert_eq!(h, block_hash);
let _ = tx.send(Ok(Some(block_header)));
}
);
assert_matches!(
virtual_overseer.recv().await,
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
h,
RuntimeApiRequest::SessionIndexForChild(tx),
)) => {
let parent_hash = session_to_hash(session, b"parent");
assert_eq!(h, parent_hash);
assert_eq!(h, block_hash);
let _ = tx.send(Ok(session));
}
);
......@@ -236,8 +223,7 @@ impl TestState {
)))
.await;
let header = self.headers.get(leaf).unwrap().clone();
self.handle_sync_queries(virtual_overseer, *leaf, header, session).await;
self.handle_sync_queries(virtual_overseer, *leaf, session).await;
}
}
......
......@@ -4,4 +4,5 @@ set -e
#shellcheck source=../common/lib.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh"
time cargo test --release --locked -p polkadot-node-core-dispute-coordinator --features disputes
time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment