From 5a263489ce03984f779e4c34ec16839a56312442 Mon Sep 17 00:00:00 2001 From: Samuel Dare Date: Fri, 5 Jul 2024 04:21:06 +0400 Subject: [PATCH] lints --- pallets/subtensor/src/staking.rs | 5 ++--- pallets/subtensor/tests/staking.rs | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pallets/subtensor/src/staking.rs b/pallets/subtensor/src/staking.rs index a14db23ed..09f6d68ac 100644 --- a/pallets/subtensor/src/staking.rs +++ b/pallets/subtensor/src/staking.rs @@ -866,7 +866,6 @@ impl Pallet { current_coldkey: T::AccountId, new_coldkey: T::AccountId, ) -> DispatchResult { - // Ensure the new coldkey is different from the current one ensure!(current_coldkey != new_coldkey, Error::::SameColdkey); @@ -885,7 +884,8 @@ impl Pallet { ); // Get the current stake - let current_stake: u64 = Self::get_stake_for_coldkey_and_hotkey(¤t_coldkey, &next_hotkey); + let current_stake: u64 = + Self::get_stake_for_coldkey_and_hotkey(¤t_coldkey, &next_hotkey); // Unstake all balance if there's any stake if current_stake > 0 { @@ -895,7 +895,6 @@ impl Pallet { current_stake, )?; } - } let total_balance = Self::get_coldkey_balance(¤t_coldkey); diff --git a/pallets/subtensor/tests/staking.rs b/pallets/subtensor/tests/staking.rs index 1dba153da..4030a0f5c 100644 --- a/pallets/subtensor/tests/staking.rs +++ b/pallets/subtensor/tests/staking.rs @@ -3181,11 +3181,10 @@ fn test_do_unstake_all_and_transfer_to_new_coldkey_success() { }); } - #[test] fn test_do_unstake_all_and_transfer_to_new_coldkey_same_coldkey() { new_test_ext(1).execute_with(|| { - let (current_coldkey, hotkey, _) = setup_test_environment(); + let (current_coldkey, _hotkey, _) = setup_test_environment(); assert_noop!( SubtensorModule::do_unstake_all_and_transfer_to_new_coldkey( @@ -3373,11 +3372,9 @@ fn test_do_unstake_all_and_transfer_to_new_coldkey_with_multiple_stakes() { }); } - #[test] fn test_do_unstake_all_and_transfer_to_new_coldkey_with_multiple_stakes_multiple() { new_test_ext(1).execute_with(|| { - // Register the neuron to a new network let netuid = 1; let hotkey0 = U256::from(1); @@ -3415,4 +3412,4 @@ fn test_do_unstake_all_and_transfer_to_new_coldkey_with_multiple_stakes_multiple .into(), ); }); -} \ No newline at end of file +}