diff --git a/zebra-chain/src/block/tests/vectors.rs b/zebra-chain/src/block/tests/vectors.rs index 3844885b8..1dcfd9a8a 100644 --- a/zebra-chain/src/block/tests/vectors.rs +++ b/zebra-chain/src/block/tests/vectors.rs @@ -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::
() - .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::
() + .expect("blockheader test vector should deserialize"); + } } #[test]