Merge pull request #294 from ethcore/ark

Fixed block queue test
This commit is contained in:
Gav Wood 2016-02-01 17:59:47 +01:00
commit 4fc9137633

View File

@ -337,23 +337,16 @@ mod tests {
} }
#[test] #[test]
fn returns_error_for_verified_duplicates() { fn returns_ok_for_drained_duplicates() {
let mut queue = get_test_queue(); let mut queue = get_test_queue();
if let Err(e) = queue.import_block(get_good_dummy_block()) { if let Err(e) = queue.import_block(get_good_dummy_block()) {
panic!("error importing block that is valid by definition({:?})", e); panic!("error importing block that is valid by definition({:?})", e);
} }
queue.drain(10);
queue.flush(); queue.flush();
queue.drain(10);
let duplicate_import = queue.import_block(get_good_dummy_block()); if let Err(e) = queue.import_block(get_good_dummy_block()) {
match duplicate_import { panic!("error importing block that has already been drained ({:?})", e);
Err(e) => {
match e {
ImportError::AlreadyQueued => {},
_ => { panic!("must return AlreadyQueued error"); }
}
}
Ok(_) => { panic!("must produce error"); }
} }
} }
} }