Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stojanov-igor committed Jul 2, 2024
1 parent e5e78eb commit 4e08855
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jam/tests/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions jam/tests/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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());
Expand Down

0 comments on commit 4e08855

Please sign in to comment.