Run deserialize_blockheader on every test vector
This commit is contained in:
parent
456842aa86
commit
9667ee650f
|
@ -50,10 +50,21 @@ fn blockheaderhash_from_blockheader() {
|
|||
|
||||
#[test]
|
||||
fn deserialize_blockheader() {
|
||||
// https://explorer.zcha.in/blocks/415000
|
||||
let _header = zebra_test::vectors::HEADER_MAINNET_415000_BYTES
|
||||
.zcash_deserialize_into::<Header>()
|
||||
.expect("blockheader test vector should deserialize");
|
||||
zebra_test::init();
|
||||
|
||||
// Includes the 32-byte nonce and 3-byte equihash length field.
|
||||
const BLOCK_HEADER_LENGTH: usize = crate::work::equihash::Solution::INPUT_LENGTH
|
||||
+ 32
|
||||
+ 3
|
||||
+ crate::work::equihash::SOLUTION_SIZE;
|
||||
|
||||
for block in zebra_test::vectors::BLOCKS.iter() {
|
||||
let header_bytes = &block[..BLOCK_HEADER_LENGTH];
|
||||
|
||||
let _header = header_bytes
|
||||
.zcash_deserialize_into::<Header>()
|
||||
.expect("blockheader test vector should deserialize");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in New Issue