Unverified Commit 1a01c3c2 authored by Bernhard Schuster's avatar Bernhard Schuster Committed by GitHub
Browse files

remove dead_code from chain selection test (#3685)

* remove dead_code from chain selection test

Ref #3674

* remove convenience consts

* disable the test suite

It is crafted for usage _with_ disputes.

* fix lockfile
parent c954bfc7
Pipeline #153828 failed with stages
in 36 minutes and 29 seconds
...@@ -31,7 +31,7 @@ pub use self::overseer::{ ...@@ -31,7 +31,7 @@ pub use self::overseer::{
create_default_subsystems, OverseerGen, OverseerGenArgs, RealOverseerGen, create_default_subsystems, OverseerGen, OverseerGenArgs, RealOverseerGen,
}; };
#[cfg(test)] #[cfg(all(test, feature = "disputes"))]
mod tests; mod tests;
#[cfg(feature = "full-node")] #[cfg(feature = "full-node")]
......
#![allow(dead_code)]
// Copyright 2021 Parity Technologies (UK) Ltd. // Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot. // This file is part of Polkadot.
...@@ -138,15 +137,6 @@ fn garbage_vrf() -> (VRFOutput, VRFProof) { ...@@ -138,15 +137,6 @@ fn garbage_vrf() -> (VRFOutput, VRFProof) {
(VRFOutput(o.to_output()), VRFProof(p)) (VRFOutput(o.to_output()), VRFProof(p))
} }
// nice to have
const A1: Hash = Hash::repeat_byte(0xA1);
const A2: Hash = Hash::repeat_byte(0xA2);
const A3: Hash = Hash::repeat_byte(0xA3);
const A5: Hash = Hash::repeat_byte(0xA5);
const B2: Hash = Hash::repeat_byte(0xB2);
const B3: Hash = Hash::repeat_byte(0xB3);
/// Representation of a local representation /// Representation of a local representation
/// to extract information for finalization target /// to extract information for finalization target
/// extraction. /// extraction.
...@@ -543,11 +533,11 @@ fn chain_0() -> CaseVars { ...@@ -543,11 +533,11 @@ fn chain_0() -> CaseVars {
CaseVars { CaseVars {
chain: builder.init(), chain: builder.init(),
target_block: A1, target_block: a1,
best_chain_containing_block: Some(A5), best_chain_containing_block: Some(a5),
highest_approved_ancestor_block: Some(A3), highest_approved_ancestor_block: Some(a3),
undisputed_chain: Some(A2), undisputed_chain: Some(a2),
expected_finality_target_result: Some(A2), expected_finality_target_result: Some(a2),
} }
} }
...@@ -571,11 +561,11 @@ fn chain_1() -> CaseVars { ...@@ -571,11 +561,11 @@ fn chain_1() -> CaseVars {
CaseVars { CaseVars {
chain: builder.init(), chain: builder.init(),
target_block: A1, target_block: a1,
best_chain_containing_block: Some(B3), best_chain_containing_block: Some(b3),
highest_approved_ancestor_block: Some(B2), highest_approved_ancestor_block: Some(b2),
undisputed_chain: Some(B2), undisputed_chain: Some(b2),
expected_finality_target_result: Some(B2), expected_finality_target_result: Some(b2),
} }
} }
...@@ -599,11 +589,11 @@ fn chain_2() -> CaseVars { ...@@ -599,11 +589,11 @@ fn chain_2() -> CaseVars {
CaseVars { CaseVars {
chain: builder.init(), chain: builder.init(),
target_block: A3, target_block: a3,
best_chain_containing_block: Some(A3), best_chain_containing_block: Some(a3),
highest_approved_ancestor_block: Some(A3), highest_approved_ancestor_block: Some(a3),
undisputed_chain: Some(A1), undisputed_chain: Some(a1),
expected_finality_target_result: Some(A1), expected_finality_target_result: Some(a1),
} }
} }
...@@ -627,11 +617,11 @@ fn chain_3() -> CaseVars { ...@@ -627,11 +617,11 @@ fn chain_3() -> CaseVars {
CaseVars { CaseVars {
chain: builder.init(), chain: builder.init(),
target_block: A2, target_block: a2,
best_chain_containing_block: Some(A3), best_chain_containing_block: Some(a3),
highest_approved_ancestor_block: Some(A3), highest_approved_ancestor_block: Some(a3),
undisputed_chain: Some(A2), undisputed_chain: Some(a2),
expected_finality_target_result: Some(A2), expected_finality_target_result: Some(a2),
} }
} }
...@@ -680,11 +670,11 @@ fn chain_5() -> CaseVars { ...@@ -680,11 +670,11 @@ fn chain_5() -> CaseVars {
CaseVars { CaseVars {
chain: builder.init(), chain: builder.init(),
target_block: A2, target_block: a2,
best_chain_containing_block: Some(A2), best_chain_containing_block: Some(a2),
highest_approved_ancestor_block: Some(A2), highest_approved_ancestor_block: Some(a2),
undisputed_chain: Some(A2), undisputed_chain: Some(a2),
expected_finality_target_result: Some(A2), expected_finality_target_result: Some(a2),
} }
} }
...@@ -725,43 +715,36 @@ fn chain_6() -> CaseVars { ...@@ -725,43 +715,36 @@ fn chain_6() -> CaseVars {
} }
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_0() { fn chain_sel_0() {
run_specialized_test_w_harness(chain_0); run_specialized_test_w_harness(chain_0);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_1() { fn chain_sel_1() {
run_specialized_test_w_harness(chain_1); run_specialized_test_w_harness(chain_1);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_2() { fn chain_sel_2() {
run_specialized_test_w_harness(chain_2); run_specialized_test_w_harness(chain_2);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_3() { fn chain_sel_3() {
run_specialized_test_w_harness(chain_3); run_specialized_test_w_harness(chain_3);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_4_target_hash_value_not_contained() { fn chain_sel_4_target_hash_value_not_contained() {
run_specialized_test_w_harness(chain_4); run_specialized_test_w_harness(chain_4);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_5_best_is_target_hash() { fn chain_sel_5_best_is_target_hash() {
run_specialized_test_w_harness(chain_5); run_specialized_test_w_harness(chain_5);
} }
#[cfg(feature = "disputes")]
#[test] #[test]
fn chain_sel_6_approval_lag() { fn chain_sel_6_approval_lag() {
run_specialized_test_w_harness(chain_6); run_specialized_test_w_harness(chain_6);
......
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