Run deserialize_blockheader on every test vector

This commit is contained in:
teor 2020-10-28 22:12:17 +10:00 committed by Deirdre Connolly
parent 456842aa86
commit 9667ee650f
1 changed files with 15 additions and 4 deletions

View File

@ -50,11 +50,22 @@ fn blockheaderhash_from_blockheader() {
#[test]
fn deserialize_blockheader() {
// https://explorer.zcha.in/blocks/415000
let _header = zebra_test::vectors::HEADER_MAINNET_415000_BYTES
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]
fn deserialize_block() {