From da1a9d2ddb71ded39207a130315a98bd41cd4071 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 23 Jul 2024 10:11:19 -0400 Subject: [PATCH 1/2] fix clippy warnings --- pallets/subtensor/tests/swap_hotkey.rs | 204 ++++++++++++------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/pallets/subtensor/tests/swap_hotkey.rs b/pallets/subtensor/tests/swap_hotkey.rs index 68f4ec49c..990382918 100644 --- a/pallets/subtensor/tests/swap_hotkey.rs +++ b/pallets/subtensor/tests/swap_hotkey.rs @@ -19,7 +19,7 @@ fn test_swap_owner() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - Owner::::insert(&old_hotkey, &coldkey); + Owner::::insert(old_hotkey, coldkey); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -27,8 +27,8 @@ fn test_swap_owner() { &mut weight )); - assert!(!Owner::::contains_key(&old_hotkey)); - assert_eq!(Owner::::get(&new_hotkey), coldkey); + assert!(!Owner::::contains_key(old_hotkey)); + assert_eq!(Owner::::get(new_hotkey), coldkey); }); } @@ -41,7 +41,7 @@ fn test_swap_owned_hotkeys() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - OwnedHotkeys::::insert(&coldkey, vec![old_hotkey]); + OwnedHotkeys::::insert(coldkey, vec![old_hotkey]); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -49,7 +49,7 @@ fn test_swap_owned_hotkeys() { &mut weight )); - let hotkeys = OwnedHotkeys::::get(&coldkey); + let hotkeys = OwnedHotkeys::::get(coldkey); assert!(!hotkeys.contains(&old_hotkey)); assert!(hotkeys.contains(&new_hotkey)); }); @@ -64,8 +64,8 @@ fn test_swap_total_hotkey_stake() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - TotalHotkeyStake::::insert(&old_hotkey, 100); - TotalHotkeyStake::::insert(&new_hotkey, 50); + TotalHotkeyStake::::insert(old_hotkey, 100); + TotalHotkeyStake::::insert(new_hotkey, 50); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -73,8 +73,8 @@ fn test_swap_total_hotkey_stake() { &mut weight )); - assert!(!TotalHotkeyStake::::contains_key(&old_hotkey)); - assert_eq!(TotalHotkeyStake::::get(&new_hotkey), 150); + assert!(!TotalHotkeyStake::::contains_key(old_hotkey)); + assert_eq!(TotalHotkeyStake::::get(new_hotkey), 150); }); } @@ -87,7 +87,7 @@ fn test_swap_total_hotkey_coldkey_stakes_this_interval() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - TotalHotkeyColdkeyStakesThisInterval::::insert(&old_hotkey, &coldkey, (100, 1000)); + TotalHotkeyColdkeyStakesThisInterval::::insert(old_hotkey, coldkey, (100, 1000)); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -96,11 +96,11 @@ fn test_swap_total_hotkey_coldkey_stakes_this_interval() { )); assert!(!TotalHotkeyColdkeyStakesThisInterval::::contains_key( - &old_hotkey, - &coldkey + old_hotkey, + coldkey )); assert_eq!( - TotalHotkeyColdkeyStakesThisInterval::::get(&new_hotkey, &coldkey), + TotalHotkeyColdkeyStakesThisInterval::::get(new_hotkey, coldkey), (100, 1000) ); }); @@ -115,7 +115,7 @@ fn test_swap_last_tx_block() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - LastTxBlock::::insert(&old_hotkey, 1000); + LastTxBlock::::insert(old_hotkey, 1000); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -123,9 +123,9 @@ fn test_swap_last_tx_block() { &mut weight )); - assert!(!LastTxBlock::::contains_key(&old_hotkey)); + assert!(!LastTxBlock::::contains_key(old_hotkey)); assert_eq!( - LastTxBlock::::get(&new_hotkey), + LastTxBlock::::get(new_hotkey), SubtensorModule::get_current_block_as_u64() ); }); @@ -140,7 +140,7 @@ fn test_swap_last_tx_block_delegate_take() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - pallet_subtensor::LastTxBlockDelegateTake::::insert(&old_hotkey, 1000); + pallet_subtensor::LastTxBlockDelegateTake::::insert(old_hotkey, 1000); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -148,9 +148,9 @@ fn test_swap_last_tx_block_delegate_take() { &mut weight )); - assert!(!LastTxBlockDelegateTake::::contains_key(&old_hotkey)); + assert!(!LastTxBlockDelegateTake::::contains_key(old_hotkey)); assert_eq!( - LastTxBlockDelegateTake::::get(&new_hotkey), + LastTxBlockDelegateTake::::get(new_hotkey), SubtensorModule::get_current_block_as_u64() ); }); @@ -189,7 +189,7 @@ fn test_swap_delegates() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - Delegates::::insert(&old_hotkey, 100); + Delegates::::insert(old_hotkey, 100); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -197,8 +197,8 @@ fn test_swap_delegates() { &mut weight )); - assert!(!Delegates::::contains_key(&old_hotkey)); - assert_eq!(Delegates::::get(&new_hotkey), 100); + assert!(!Delegates::::contains_key(old_hotkey)); + assert_eq!(Delegates::::get(new_hotkey), 100); }); } @@ -213,7 +213,7 @@ fn test_swap_subnet_membership() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); + IsNetworkMember::::insert(old_hotkey, netuid, true); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, &new_hotkey, @@ -221,8 +221,8 @@ fn test_swap_subnet_membership() { &mut weight )); - assert!(!IsNetworkMember::::contains_key(&old_hotkey, netuid)); - assert!(IsNetworkMember::::get(&new_hotkey, netuid)); + assert!(!IsNetworkMember::::contains_key(old_hotkey, netuid)); + assert!(IsNetworkMember::::get(new_hotkey, netuid)); }); } @@ -238,8 +238,8 @@ fn test_swap_uids_and_keys() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); - Uids::::insert(netuid, &old_hotkey, uid); + IsNetworkMember::::insert(old_hotkey, netuid, true); + Uids::::insert(netuid, old_hotkey, uid); Keys::::insert(netuid, uid, old_hotkey); assert_ok!(SubtensorModule::perform_hotkey_swap( @@ -249,8 +249,8 @@ fn test_swap_uids_and_keys() { &mut weight )); - assert_eq!(Uids::::get(netuid, &old_hotkey), None); - assert_eq!(Uids::::get(netuid, &new_hotkey), Some(uid)); + assert_eq!(Uids::::get(netuid, old_hotkey), None); + assert_eq!(Uids::::get(netuid, new_hotkey), Some(uid)); assert_eq!(Keys::::get(netuid, uid), new_hotkey); }); } @@ -267,8 +267,8 @@ fn test_swap_prometheus() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); - Prometheus::::insert(netuid, &old_hotkey, prometheus_info.clone()); + IsNetworkMember::::insert(old_hotkey, netuid, true); + Prometheus::::insert(netuid, old_hotkey, prometheus_info.clone()); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -277,9 +277,9 @@ fn test_swap_prometheus() { &mut weight )); - assert!(!Prometheus::::contains_key(netuid, &old_hotkey)); + assert!(!Prometheus::::contains_key(netuid, old_hotkey)); assert_eq!( - Prometheus::::get(netuid, &new_hotkey), + Prometheus::::get(netuid, new_hotkey), Some(prometheus_info) ); }); @@ -297,8 +297,8 @@ fn test_swap_axons() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); - Axons::::insert(netuid, &old_hotkey, axon_info.clone()); + IsNetworkMember::::insert(old_hotkey, netuid, true); + Axons::::insert(netuid, old_hotkey, axon_info.clone()); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -307,8 +307,8 @@ fn test_swap_axons() { &mut weight )); - assert!(!Axons::::contains_key(netuid, &old_hotkey)); - assert_eq!(Axons::::get(netuid, &new_hotkey), Some(axon_info)); + assert!(!Axons::::contains_key(netuid, old_hotkey)); + assert_eq!(Axons::::get(netuid, new_hotkey), Some(axon_info)); }); } @@ -324,8 +324,8 @@ fn test_swap_weight_commits() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); - WeightCommits::::insert(netuid, &old_hotkey, weight_commits.clone()); + IsNetworkMember::::insert(old_hotkey, netuid, true); + WeightCommits::::insert(netuid, old_hotkey, weight_commits); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -334,9 +334,9 @@ fn test_swap_weight_commits() { &mut weight )); - assert!(!WeightCommits::::contains_key(netuid, &old_hotkey)); + assert!(!WeightCommits::::contains_key(netuid, old_hotkey)); assert_eq!( - WeightCommits::::get(netuid, &new_hotkey), + WeightCommits::::get(netuid, new_hotkey), Some(weight_commits) ); }); @@ -355,7 +355,7 @@ fn test_swap_loaded_emission() { let mut weight = Weight::zero(); add_network(netuid, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid, true); + IsNetworkMember::::insert(old_hotkey, netuid, true); LoadedEmission::::insert( netuid, vec![(old_hotkey, server_emission, validator_emission)], @@ -386,7 +386,7 @@ fn test_swap_stake() { let stake_amount = 100u64; let mut weight = Weight::zero(); - Stake::::insert(&old_hotkey, &coldkey, stake_amount); + Stake::::insert(old_hotkey, coldkey, stake_amount); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -395,8 +395,8 @@ fn test_swap_stake() { &mut weight )); - assert!(!Stake::::contains_key(&old_hotkey, &coldkey)); - assert_eq!(Stake::::get(&new_hotkey, &coldkey), stake_amount); + assert!(!Stake::::contains_key(old_hotkey, coldkey)); + assert_eq!(Stake::::get(new_hotkey, coldkey), stake_amount); }); } @@ -409,8 +409,8 @@ fn test_swap_staking_hotkeys() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - Stake::::insert(&old_hotkey, &coldkey, 100); - StakingHotkeys::::insert(&coldkey, vec![old_hotkey]); + Stake::::insert(old_hotkey, coldkey, 100); + StakingHotkeys::::insert(coldkey, vec![old_hotkey]); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -419,7 +419,7 @@ fn test_swap_staking_hotkeys() { &mut weight )); - let staking_hotkeys = StakingHotkeys::::get(&coldkey); + let staking_hotkeys = StakingHotkeys::::get(coldkey); assert!(!staking_hotkeys.contains(&old_hotkey)); assert!(staking_hotkeys.contains(&new_hotkey)); }); @@ -435,10 +435,10 @@ fn test_swap_hotkey_with_multiple_coldkeys() { let coldkey2 = U256::from(4); let mut weight = Weight::zero(); - Stake::::insert(&old_hotkey, &coldkey1, 100); - Stake::::insert(&old_hotkey, &coldkey2, 200); - StakingHotkeys::::insert(&coldkey1, vec![old_hotkey]); - StakingHotkeys::::insert(&coldkey2, vec![old_hotkey]); + Stake::::insert(old_hotkey, coldkey1, 100); + Stake::::insert(old_hotkey, coldkey2, 200); + StakingHotkeys::::insert(coldkey1, vec![old_hotkey]); + StakingHotkeys::::insert(coldkey2, vec![old_hotkey]); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -447,10 +447,10 @@ fn test_swap_hotkey_with_multiple_coldkeys() { &mut weight )); - assert_eq!(Stake::::get(&new_hotkey, &coldkey1), 100); - assert_eq!(Stake::::get(&new_hotkey, &coldkey2), 200); - assert!(StakingHotkeys::::get(&coldkey1).contains(&new_hotkey)); - assert!(StakingHotkeys::::get(&coldkey2).contains(&new_hotkey)); + assert_eq!(Stake::::get(new_hotkey, coldkey1), 100); + assert_eq!(Stake::::get(new_hotkey, coldkey2), 200); + assert!(StakingHotkeys::::get(coldkey1).contains(&new_hotkey)); + assert!(StakingHotkeys::::get(coldkey2).contains(&new_hotkey)); }); } @@ -463,8 +463,8 @@ fn test_swap_hotkey_with_existing_stake() { let coldkey = U256::from(3); let mut weight = Weight::zero(); - Stake::::insert(&old_hotkey, &coldkey, 100); - Stake::::insert(&new_hotkey, &coldkey, 50); + Stake::::insert(old_hotkey, coldkey, 100); + Stake::::insert(new_hotkey, coldkey, 50); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -473,7 +473,7 @@ fn test_swap_hotkey_with_existing_stake() { &mut weight )); - assert_eq!(Stake::::get(&new_hotkey, &coldkey), 150); + assert_eq!(Stake::::get(new_hotkey, coldkey), 150); }); } @@ -490,8 +490,8 @@ fn test_swap_hotkey_with_multiple_subnets() { add_network(netuid1, 0, 1); add_network(netuid2, 0, 1); - IsNetworkMember::::insert(&old_hotkey, netuid1, true); - IsNetworkMember::::insert(&old_hotkey, netuid2, true); + IsNetworkMember::::insert(old_hotkey, netuid1, true); + IsNetworkMember::::insert(old_hotkey, netuid2, true); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -500,10 +500,10 @@ fn test_swap_hotkey_with_multiple_subnets() { &mut weight )); - assert!(IsNetworkMember::::get(&new_hotkey, netuid1)); - assert!(IsNetworkMember::::get(&new_hotkey, netuid2)); - assert!(!IsNetworkMember::::get(&old_hotkey, netuid1)); - assert!(!IsNetworkMember::::get(&old_hotkey, netuid2)); + assert!(IsNetworkMember::::get(new_hotkey, netuid1)); + assert!(IsNetworkMember::::get(new_hotkey, netuid2)); + assert!(!IsNetworkMember::::get(old_hotkey, netuid1)); + assert!(!IsNetworkMember::::get(old_hotkey, netuid2)); }); } @@ -518,10 +518,10 @@ fn test_swap_staking_hotkeys_multiple_coldkeys() { let mut weight = Weight::zero(); // Set up initial state - Stake::::insert(&old_hotkey, &coldkey1, 100); - Stake::::insert(&old_hotkey, &coldkey2, 200); - StakingHotkeys::::insert(&coldkey1, vec![old_hotkey]); - StakingHotkeys::::insert(&coldkey2, vec![old_hotkey, U256::from(5)]); + Stake::::insert(old_hotkey, coldkey1, 100); + Stake::::insert(old_hotkey, coldkey2, 200); + StakingHotkeys::::insert(coldkey1, vec![old_hotkey]); + StakingHotkeys::::insert(coldkey2, vec![old_hotkey, U256::from(5)]); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -531,13 +531,13 @@ fn test_swap_staking_hotkeys_multiple_coldkeys() { )); // Check if new_hotkey replaced old_hotkey in StakingHotkeys - assert!(StakingHotkeys::::get(&coldkey1).contains(&new_hotkey)); - assert!(!StakingHotkeys::::get(&coldkey1).contains(&old_hotkey)); + assert!(StakingHotkeys::::get(coldkey1).contains(&new_hotkey)); + assert!(!StakingHotkeys::::get(coldkey1).contains(&old_hotkey)); // Check if new_hotkey replaced old_hotkey for coldkey2 as well - assert!(StakingHotkeys::::get(&coldkey2).contains(&new_hotkey)); - assert!(!StakingHotkeys::::get(&coldkey2).contains(&old_hotkey)); - assert!(StakingHotkeys::::get(&coldkey2).contains(&U256::from(5))); + assert!(StakingHotkeys::::get(coldkey2).contains(&new_hotkey)); + assert!(!StakingHotkeys::::get(coldkey2).contains(&old_hotkey)); + assert!(StakingHotkeys::::get(coldkey2).contains(&U256::from(5))); // Other hotkeys should remain }); } @@ -552,7 +552,7 @@ fn test_swap_hotkey_with_no_stake() { let mut weight = Weight::zero(); // Set up initial state with no stake - Owner::::insert(&old_hotkey, &coldkey); + Owner::::insert(old_hotkey, coldkey); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -562,12 +562,12 @@ fn test_swap_hotkey_with_no_stake() { )); // Check if ownership transferred - assert!(!Owner::::contains_key(&old_hotkey)); - assert_eq!(Owner::::get(&new_hotkey), coldkey); + assert!(!Owner::::contains_key(old_hotkey)); + assert_eq!(Owner::::get(new_hotkey), coldkey); // Ensure no unexpected changes in Stake - assert!(!Stake::::contains_key(&old_hotkey, &coldkey)); - assert!(!Stake::::contains_key(&new_hotkey, &coldkey)); + assert!(!Stake::::contains_key(old_hotkey, coldkey)); + assert!(!Stake::::contains_key(new_hotkey, coldkey)); }); } @@ -586,12 +586,12 @@ fn test_swap_hotkey_with_multiple_coldkeys_and_subnets() { // Set up initial state add_network(netuid1, 0, 1); add_network(netuid2, 0, 1); - Owner::::insert(&old_hotkey, &coldkey1); - Stake::::insert(&old_hotkey, &coldkey1, 100); - Stake::::insert(&old_hotkey, &coldkey2, 200); - IsNetworkMember::::insert(&old_hotkey, netuid1, true); - IsNetworkMember::::insert(&old_hotkey, netuid2, true); - TotalHotkeyStake::::insert(&old_hotkey, 300); + Owner::::insert(old_hotkey, coldkey1); + Stake::::insert(old_hotkey, coldkey1, 100); + Stake::::insert(old_hotkey, coldkey2, 200); + IsNetworkMember::::insert(old_hotkey, netuid1, true); + IsNetworkMember::::insert(old_hotkey, netuid2, true); + TotalHotkeyStake::::insert(old_hotkey, 300); assert_ok!(SubtensorModule::perform_hotkey_swap( &old_hotkey, @@ -601,24 +601,24 @@ fn test_swap_hotkey_with_multiple_coldkeys_and_subnets() { )); // Check ownership transfer - assert!(!Owner::::contains_key(&old_hotkey)); - assert_eq!(Owner::::get(&new_hotkey), coldkey1); + assert!(!Owner::::contains_key(old_hotkey)); + assert_eq!(Owner::::get(new_hotkey), coldkey1); // Check stake transfer - assert_eq!(Stake::::get(&new_hotkey, &coldkey1), 100); - assert_eq!(Stake::::get(&new_hotkey, &coldkey2), 200); - assert!(!Stake::::contains_key(&old_hotkey, &coldkey1)); - assert!(!Stake::::contains_key(&old_hotkey, &coldkey2)); + assert_eq!(Stake::::get(new_hotkey, coldkey1), 100); + assert_eq!(Stake::::get(new_hotkey, coldkey2), 200); + assert!(!Stake::::contains_key(old_hotkey, coldkey1)); + assert!(!Stake::::contains_key(old_hotkey, coldkey2)); // Check subnet membership transfer - assert!(IsNetworkMember::::get(&new_hotkey, netuid1)); - assert!(IsNetworkMember::::get(&new_hotkey, netuid2)); - assert!(!IsNetworkMember::::get(&old_hotkey, netuid1)); - assert!(!IsNetworkMember::::get(&old_hotkey, netuid2)); + assert!(IsNetworkMember::::get(new_hotkey, netuid1)); + assert!(IsNetworkMember::::get(new_hotkey, netuid2)); + assert!(!IsNetworkMember::::get(old_hotkey, netuid1)); + assert!(!IsNetworkMember::::get(old_hotkey, netuid2)); // Check total stake transfer - assert_eq!(TotalHotkeyStake::::get(&new_hotkey), 300); - assert!(!TotalHotkeyStake::::contains_key(&old_hotkey)); + assert_eq!(TotalHotkeyStake::::get(new_hotkey), 300); + assert!(!TotalHotkeyStake::::contains_key(old_hotkey)); }); } @@ -899,9 +899,9 @@ fn test_swap_hotkey_error_cases() { let wrong_coldkey = U256::from(4); // Set up initial state - Owner::::insert(&old_hotkey, &coldkey); + Owner::::insert(old_hotkey, coldkey); TotalNetworks::::put(1); - LastTxBlock::::insert(&coldkey, 0); + LastTxBlock::::insert(coldkey, 0); // Test not enough balance let swap_cost = SubtensorModule::get_key_swap_cost(); @@ -928,7 +928,7 @@ fn test_swap_hotkey_error_cases() { ); // Test new hotkey already registered - IsNetworkMember::::insert(&new_hotkey, 0, true); + IsNetworkMember::::insert(new_hotkey, 0, true); assert_noop!( SubtensorModule::do_swap_hotkey( RuntimeOrigin::signed(coldkey), @@ -937,7 +937,7 @@ fn test_swap_hotkey_error_cases() { ), Error::::HotKeyAlreadyRegisteredInSubNet ); - IsNetworkMember::::remove(&new_hotkey, 0); + IsNetworkMember::::remove(new_hotkey, 0); // Test non-associated coldkey assert_noop!( @@ -958,7 +958,7 @@ fn test_swap_hotkey_error_cases() { // Check balance after swap assert_eq!( - Balances::free_balance(&coldkey), + Balances::free_balance(coldkey), initial_balance - swap_cost ); }); From 8e4bf4c763ddd0dd935b53558b6768f4f73b39b6 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 23 Jul 2024 10:16:39 -0400 Subject: [PATCH 2/2] fmt --- pallets/subtensor/tests/swap_hotkey.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pallets/subtensor/tests/swap_hotkey.rs b/pallets/subtensor/tests/swap_hotkey.rs index 990382918..c6a05f2b6 100644 --- a/pallets/subtensor/tests/swap_hotkey.rs +++ b/pallets/subtensor/tests/swap_hotkey.rs @@ -96,8 +96,7 @@ fn test_swap_total_hotkey_coldkey_stakes_this_interval() { )); assert!(!TotalHotkeyColdkeyStakesThisInterval::::contains_key( - old_hotkey, - coldkey + old_hotkey, coldkey )); assert_eq!( TotalHotkeyColdkeyStakesThisInterval::::get(new_hotkey, coldkey), @@ -957,9 +956,6 @@ fn test_swap_hotkey_error_cases() { )); // Check balance after swap - assert_eq!( - Balances::free_balance(coldkey), - initial_balance - swap_cost - ); + assert_eq!(Balances::free_balance(coldkey), initial_balance - swap_cost); }); }