From bd81c376cd3dc6043c9549b4751a0e647b9106a3 Mon Sep 17 00:00:00 2001 From: grumbach Date: Fri, 5 Jul 2024 18:39:34 +0200 Subject: [PATCH] chore: fmt --- sn_node/tests/double_spend.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/sn_node/tests/double_spend.rs b/sn_node/tests/double_spend.rs index 96c4cb6fc2..bb407baad2 100644 --- a/sn_node/tests/double_spend.rs +++ b/sn_node/tests/double_spend.rs @@ -16,7 +16,8 @@ use itertools::Itertools; use sn_logging::LogBuilder; use sn_networking::NetworkError; use sn_transfers::{ - get_genesis_sk, rng, DerivationIndex, HotWallet, NanoTokens, OfflineTransfer, SpendReason, WalletError, GENESIS_CASHNOTE + get_genesis_sk, rng, DerivationIndex, HotWallet, NanoTokens, OfflineTransfer, SpendReason, + WalletError, GENESIS_CASHNOTE, }; use std::time::Duration; use tracing::*; @@ -518,13 +519,20 @@ async fn spamming_double_spends_should_not_shadow_live_branch() -> Result<()> { }); // the original A should still be present as one of the double spends - let res = client.get_spend_from_network(original_a_spend.address()).await; - assert_matches!(res, Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt(_)))); + let res = client + .get_spend_from_network(original_a_spend.address()) + .await; + assert_matches!( + res, + Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt( + _ + ))) + ); if let Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt(spends))) = res { assert!(spends.iter().contains(original_a_spend)) } - // Try to double spend A -> 10 different random keys + // Try to double spend A -> n different random keys for _ in 0..20 { println!("Spamming double spends on A"); let wallet_dir_y = TempDir::new()?; @@ -554,8 +562,15 @@ async fn spamming_double_spends_should_not_shadow_live_branch() -> Result<()> { }); // the original A should still be present as one of the double spends - let res = client.get_spend_from_network(original_a_spend.address()).await; - assert_matches!(res, Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt(_)))); + let res = client + .get_spend_from_network(original_a_spend.address()) + .await; + assert_matches!( + res, + Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt( + _ + ))) + ); if let Err(sn_client::Error::Network(NetworkError::DoubleSpendAttempt(spends))) = res { assert!(spends.iter().contains(original_a_spend)) }