From 4e08855f22c224bb7398bdb350f7e4116861da02 Mon Sep 17 00:00:00 2001 From: Joseph Knecht <83087510+JosephKnecht-lab@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:33:11 +0200 Subject: [PATCH] fix tests --- jam/tests/block.rs | 2 +- jam/tests/blockchain.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jam/tests/block.rs b/jam/tests/block.rs index bff27d8..8c3c60f 100644 --- a/jam/tests/block.rs +++ b/jam/tests/block.rs @@ -10,7 +10,7 @@ mod tests { #[tokio::test] async fn test_automatic_block_creation() { - let blockchain = Arc::new(Mutex::new(Blockchain::new(2))); + let blockchain = Arc::new(Mutex::new(Blockchain::new(2, 50.0))); // Start block production let blockchain_clone = blockchain.clone(); diff --git a/jam/tests/blockchain.rs b/jam/tests/blockchain.rs index 6b6e877..db6b985 100644 --- a/jam/tests/blockchain.rs +++ b/jam/tests/blockchain.rs @@ -7,7 +7,7 @@ mod tests { #[test] fn test_create_genesis_block() { - let blockchain = Blockchain::new(2); + let blockchain = Blockchain::new(2, 50.0); assert_eq!(blockchain.chain.len(), 1); let genesis_block = &blockchain.chain[0]; assert_eq!(genesis_block.index, 0); @@ -21,7 +21,7 @@ mod tests { #[test] fn test_add_transaction() { - let mut blockchain = Blockchain::new(2); + let mut blockchain = Blockchain::new(2, 50.0); let transaction = Transaction::new("Alice".to_string(), "Bob".to_string(), 10.0, 1); blockchain.add_transaction(transaction.clone()); assert_eq!(blockchain.pending_transactions.len(), 1); @@ -30,7 +30,7 @@ mod tests { #[test] fn test_mine_pending_transactions() { - let mut blockchain = Blockchain::new(2); + let mut blockchain = Blockchain::new(2, 50.0); blockchain.add_transaction(Transaction::new("Alice".to_string(), "Bob".to_string(), 10.0, 1)); blockchain.mine_pending_transactions("Miner1".to_string()); assert_eq!(blockchain.chain.len(), 2); @@ -43,7 +43,7 @@ mod tests { #[test] fn test_is_chain_valid() { - let mut blockchain = Blockchain::new(2); + let mut blockchain = Blockchain::new(2, 50.0); blockchain.add_transaction(Transaction::new("Alice".to_string(), "Bob".to_string(), 10.0, 1)); blockchain.mine_pending_transactions("Miner1".to_string()); assert!(blockchain.is_chain_valid());