From 6e717c017fa8f8cf01f4cf1c39b7a00109cde008 Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 2 Feb 2016 21:06:21 +0100 Subject: [PATCH] Fixed queue test --- ethcore/src/block_queue.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ethcore/src/block_queue.rs b/ethcore/src/block_queue.rs index 1c0cc41ae..1fe31ba19 100644 --- a/ethcore/src/block_queue.rs +++ b/ethcore/src/block_queue.rs @@ -316,6 +316,7 @@ mod tests { use block_queue::*; use tests::helpers::*; use error::*; + use views::*; fn get_test_queue() -> BlockQueue { let spec = get_test_spec(); @@ -361,11 +362,14 @@ mod tests { #[test] fn returns_ok_for_drained_duplicates() { let mut queue = get_test_queue(); - if let Err(e) = queue.import_block(get_good_dummy_block()) { + let block = get_good_dummy_block(); + let hash = BlockView::new(&block).header().hash().clone(); + if let Err(e) = queue.import_block(block) { panic!("error importing block that is valid by definition({:?})", e); } queue.flush(); queue.drain(10); + queue.mark_as_good(&[ hash ]); if let Err(e) = queue.import_block(get_good_dummy_block()) { panic!("error importing block that has already been drained ({:?})", e);