From a25801fc2cdb1cf2d37a210725c7b0e2b15ea5aa Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Wed, 9 Sep 2020 23:21:51 -0700 Subject: [PATCH] consensus: remove length-1 checkpoint list test This test aimed to exercise both the checkpoint and block verifiers by making a checkpoint list of length 1. However, the block verifier can't work on any blocks below Sapling activation. --- zebra-consensus/src/chain/tests.rs | 40 ------------------------------ 1 file changed, 40 deletions(-) diff --git a/zebra-consensus/src/chain/tests.rs b/zebra-consensus/src/chain/tests.rs index 7320b57c5..f760fea82 100644 --- a/zebra-consensus/src/chain/tests.rs +++ b/zebra-consensus/src/chain/tests.rs @@ -92,23 +92,6 @@ static BLOCK_VERIFY_TRANSCRIPT_GENESIS_FAIL: Lazy< vec![(block, Err(TransError::Any))] }); -static BLOCK_VERIFY_TRANSCRIPT_GENESIS_TO_BLOCK_1: Lazy< - Vec<(Arc, Result)>, -> = Lazy::new(|| { - let block0: Arc<_> = - Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..]) - .unwrap() - .into(); - let hash0 = Ok(block0.hash()); - - let block1: Arc<_> = Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_1_BYTES[..]) - .unwrap() - .into(); - let hash1 = Ok(block1.hash()); - - vec![(block0, hash0), (block1, hash1)] -}); - static NO_COINBASE_TRANSCRIPT: Lazy, Result)>> = Lazy::new(|| { let block = block_no_transactions(); @@ -138,29 +121,6 @@ static STATE_VERIFY_TRANSCRIPT_GENESIS: Lazy Result<(), Report> { - verify_genesis().await -} - -/// Test that block verifies work -/// -/// Uses a custom checkpoint list, containing only the genesis block. Since the -/// maximum checkpoint height is 0, non-genesis blocks are verified using the -/// BlockVerifier. -#[spandoc::spandoc] -async fn verify_genesis() -> Result<(), Report> { - zebra_test::init(); - - // The hardcoded checkpoint list contains the genesis block. - let (chain_verifier, _) = verifiers_from_network(Network::Mainnet).await; - - let transcript = Transcript::from(BLOCK_VERIFY_TRANSCRIPT_GENESIS_TO_BLOCK_1.iter().cloned()); - transcript.check(chain_verifier).await.unwrap(); - - Ok(()) -} - #[tokio::test] async fn verify_checkpoint_test() -> Result<(), Report> { verify_checkpoint(Config {