From 550681e7c83d1e230a1c40f85da86ea9c43c0f1e Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 25 Oct 2023 17:02:54 -0300 Subject: [PATCH] add more checks to test --- zebra-scanner/src/tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zebra-scanner/src/tests.rs b/zebra-scanner/src/tests.rs index 3dfc66d2e10..fd6c2df1195 100644 --- a/zebra-scanner/src/tests.rs +++ b/zebra-scanner/src/tests.rs @@ -148,7 +148,7 @@ async fn scanning_from_fake_generated_blocks() -> Result<()> { let res = scan_block( &zcash_primitives::consensus::MainNetwork, - cb, + cb.clone(), &vks[..], &[(account, nf)], None, @@ -157,6 +157,11 @@ async fn scanning_from_fake_generated_blocks() -> Result<()> { // The response should have one transaction relevant to the key we provided. assert_eq!(res.transactions().len(), 1); + // The transaction should be the one we provided, second one in the block. + // (random transaction is added before ours in `fake_compact_block` function) + assert_eq!(res.transactions()[0].txid, cb.vtx[1].txid()); + // The block hash of the response should be the same as the one provided. + assert_eq!(res.block_hash(), cb.hash()); Ok(()) }