mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 08:07:58 +00:00
Support synching of blocks that are not new_best (#6508)
* Start * Remove debug println * Add tests
This commit is contained in:
@@ -59,7 +59,7 @@ fn import_single_good_block_works() {
|
||||
&mut substrate_test_runtime_client::new(),
|
||||
BlockOrigin::File,
|
||||
block,
|
||||
&mut PassThroughVerifier(true)
|
||||
&mut PassThroughVerifier::new(true)
|
||||
) {
|
||||
Ok(BlockImportResult::ImportedUnknown(ref num, ref aux, ref org))
|
||||
if *num == number && *aux == expected_aux && *org == Some(peer_id) => {}
|
||||
@@ -74,7 +74,7 @@ fn import_single_good_known_block_is_ignored() {
|
||||
&mut client,
|
||||
BlockOrigin::File,
|
||||
block,
|
||||
&mut PassThroughVerifier(true)
|
||||
&mut PassThroughVerifier::new(true)
|
||||
) {
|
||||
Ok(BlockImportResult::ImportedKnown(ref n)) if *n == number => {}
|
||||
_ => panic!()
|
||||
@@ -89,7 +89,7 @@ fn import_single_good_block_without_header_fails() {
|
||||
&mut substrate_test_runtime_client::new(),
|
||||
BlockOrigin::File,
|
||||
block,
|
||||
&mut PassThroughVerifier(true)
|
||||
&mut PassThroughVerifier::new(true)
|
||||
) {
|
||||
Err(BlockImportError::IncompleteHeader(ref org)) if *org == Some(peer_id) => {}
|
||||
_ => panic!()
|
||||
@@ -101,7 +101,7 @@ fn async_import_queue_drops() {
|
||||
let executor = sp_core::testing::SpawnBlockingExecutor::new();
|
||||
// Perform this test multiple times since it exhibits non-deterministic behavior.
|
||||
for _ in 0..100 {
|
||||
let verifier = PassThroughVerifier(true);
|
||||
let verifier = PassThroughVerifier::new(true);
|
||||
|
||||
let queue = BasicQueue::new(
|
||||
verifier,
|
||||
|
||||
Reference in New Issue
Block a user