From dc1f2cdda21e98116bc434dd2614ce7098ec025e Mon Sep 17 00:00:00 2001 From: stringhandler Date: Mon, 9 Dec 2024 15:49:00 +0200 Subject: [PATCH] remove old test --- src/sharechain/p2chain.rs | 76 --------------------------------------- 1 file changed, 76 deletions(-) diff --git a/src/sharechain/p2chain.rs b/src/sharechain/p2chain.rs index 3ce8ebf..701bc99 100644 --- a/src/sharechain/p2chain.rs +++ b/src/sharechain/p2chain.rs @@ -987,82 +987,6 @@ mod test { assert_eq!(level.height, 6); } - #[test] - fn test_dont_set_tip_on_single_high_height() { - let mut chain = P2Chain::new_empty(10, 5, 10); - - let mut prev_block = None; - let mut tari_block = Block::new(BlockHeader::new(0), AggregateBody::empty()); - for i in 0..5 { - tari_block.header.nonce = i; - let address = new_random_address(); - let block = P2BlockBuilder::new(prev_block.as_ref()) - .with_timestamp(EpochTime::now()) - .with_height(i) - .with_tari_block(tari_block.clone()) - .unwrap() - .with_miner_wallet_address(address.clone()) - .build() - .unwrap(); - prev_block = Some(block.clone()); - chain.add_block_to_chain(block.clone()).unwrap(); - - let level = chain.get_tip().unwrap(); - assert_eq!(level.height, i); - } - // we do this so we can add a missing parent or 2 - let address = new_random_address(); - let block = P2BlockBuilder::new(prev_block.as_ref()) - .with_timestamp(EpochTime::now()) - .with_height(100) - .with_tari_block(tari_block.clone()) - .unwrap() - .with_miner_wallet_address(address.clone()) - .build() - .unwrap(); - prev_block = Some(block.clone()); - let address = new_random_address(); - let block = P2BlockBuilder::new(prev_block.as_ref()) - .with_timestamp(EpochTime::now()) - .with_height(2000) - .with_tari_block(tari_block.clone()) - .unwrap() - .with_miner_wallet_address(address.clone()) - .build() - .unwrap(); - prev_block = Some(block.clone()); - - chain.add_block_to_chain(block.clone()).unwrap(); - - let level = chain.get_tip().unwrap(); - assert_eq!(level.height, 4); - - let address = new_random_address(); - let block = P2BlockBuilder::new(prev_block.as_ref()) - .with_timestamp(EpochTime::now()) - .with_height(1000) - .with_tari_block(tari_block.clone()) - .unwrap() - .with_miner_wallet_address(address.clone()) - .build() - .unwrap(); - prev_block = Some(block.clone()); - let address = new_random_address(); - let block = P2BlockBuilder::new(prev_block.as_ref()) - .with_timestamp(EpochTime::now()) - .with_height(20000) - .with_tari_block(tari_block.clone()) - .unwrap() - .with_miner_wallet_address(address.clone()) - .build() - .unwrap(); - - chain.add_block_to_chain(block.clone()).unwrap(); - - let level = chain.get_tip().unwrap(); - assert_eq!(level.height, 4); - } - #[test] fn get_parent() { let mut chain = P2Chain::new_empty(10, 5, 10);