Test equihash solution for all block test vectors

This commit is contained in:
teor 2020-10-13 08:33:44 +10:00
parent d241e0b3fc
commit 7ce3e2e43a
1 changed files with 16 additions and 0 deletions

View File

@ -129,6 +129,22 @@ async fn check_transcripts() -> Result<(), Report> {
Ok(())
}
#[test]
fn equihash_is_valid_for_historical_blocks() -> Result<(), Report> {
let block_iter = zebra_test::vectors::BLOCKS.iter();
for block in block_iter {
let block = block
.zcash_deserialize_into::<Block>()
.expect("block is structurally valid");
check::equihash_solution_is_valid(&block.header)
.expect("the equihash solution from a historical block should be valid");
}
Ok(())
}
#[test]
fn subsidy_is_valid_for_historical_blocks() -> Result<(), Report> {
subsidy_is_valid_for_network(Network::Mainnet)?;