Add more checks after deserializing issuance block in issuance_block test

This commit is contained in:
Dmitry Demin 2024-11-11 22:02:36 +01:00
parent c3a8583903
commit 4855c25724
1 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,4 @@
use crate::{block::Block, serialization::ZcashDeserialize};
use crate::{block::Block, serialization::ZcashDeserialize, transaction::Transaction};
use super::vectors::BLOCKS;
@ -6,4 +6,20 @@ use super::vectors::BLOCKS;
fn issuance_block() {
let issuance_block =
Block::zcash_deserialize(BLOCKS[0].as_ref()).expect("issuance block should deserialize");
for transaction in issuance_block.transactions {
if let Transaction::V6 {
orchard_zsa_issue_data,
..
} = transaction.as_ref()
{
let issue_bundle = orchard_zsa_issue_data
.as_ref()
.expect("V6 transaction in the issuance test block has orchard_zsa_issue_data")
.inner();
assert_eq!(issue_bundle.actions().len(), 1);
assert_eq!(issue_bundle.actions()[0].notes().len(), 1);
}
}
}