Run deserialize_blockheader on every test vector
@@ -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() {
