chore(db): Add tests and fuzz target to BlockNumHash (#130)

* add tests and fuzz target for BlockNumHash

* use block 1 for test_block_num_hash

* new clippy stds

* fmt
This commit is contained in:
joshieDo
2022-10-25 16:23:10 +08:00
committed by GitHub
parent 0998fc3eb7
commit 2a8189d7c9
22 changed files with 141 additions and 87 deletions

View File

@ -39,7 +39,7 @@ impl Command {
}
Err(error) => {
num_of_failed += 1;
println!("Test {:?} failed:\n {error}\n", file);
println!("Test {file:?} failed:\n {error}\n");
}
}
}

View File

@ -335,7 +335,7 @@ mod test {
}"#;
let res = serde_json::from_str::<Test>(test);
assert!(res.is_ok(), "Failed to deserialize BlockchainTestData with error: {:?}", res);
assert!(res.is_ok(), "Failed to deserialize BlockchainTestData with error: {res:?}");
}
#[test]
@ -360,7 +360,7 @@ mod test {
"uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}"#;
let res = serde_json::from_str::<Header>(test);
assert!(res.is_ok(), "Failed to deserialize Header with error: {:?}", res);
assert!(res.is_ok(), "Failed to deserialize Header with error: {res:?}");
}
#[test]
@ -386,6 +386,6 @@ mod test {
]"#;
let res = serde_json::from_str::<Vec<Transaction>>(test);
assert!(res.is_ok(), "Failed to deserialize transactin with error: {:?}", res);
assert!(res.is_ok(), "Failed to deserialize transactin with error: {res:?}");
}
}