mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-01 15:57:24 +00:00
Check for block parent before verification. (#1714)
* Treat verification errors more seriously * Track obsolete requests * Check block parent before verification * Style
This commit is contained in:
@@ -129,8 +129,9 @@ fn process_import_result_works() {
|
||||
|
||||
let link = TestLink::new();
|
||||
assert_eq!(process_import_result::<Block>(&link, Err(BlockImportError::IncompleteHeader(Some(0)))), 0);
|
||||
assert_eq!(link.total(), 1);
|
||||
assert_eq!(link.total(), 2);
|
||||
assert_eq!(link.disconnects.get(), 1);
|
||||
assert_eq!(link.restarts.get(), 1);
|
||||
|
||||
let link = TestLink::new();
|
||||
assert_eq!(process_import_result::<Block>(&link, Err(BlockImportError::UnknownParent)), 0);
|
||||
@@ -141,6 +142,12 @@ fn process_import_result_works() {
|
||||
assert_eq!(process_import_result::<Block>(&link, Err(BlockImportError::Error)), 0);
|
||||
assert_eq!(link.total(), 1);
|
||||
assert_eq!(link.restarts.get(), 1);
|
||||
|
||||
let link = TestLink::new();
|
||||
assert_eq!(process_import_result::<Block>(&link, Err(BlockImportError::VerificationFailed(Some(0), String::new()))), 0);
|
||||
assert_eq!(link.total(), 2);
|
||||
assert_eq!(link.restarts.get(), 1);
|
||||
assert_eq!(link.disconnects.get(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user