diff --git a/pallets/subtensor/src/registration.rs b/pallets/subtensor/src/registration.rs index c26c9a8cb..a92585f68 100644 --- a/pallets/subtensor/src/registration.rs +++ b/pallets/subtensor/src/registration.rs @@ -1,5 +1,5 @@ use super::*; -use frame_support::pallet_prelude::{DispatchResult, DispatchResultWithPostInfo}; +use frame_support::pallet_prelude::DispatchResultWithPostInfo; use frame_support::storage::IterableStorageDoubleMap; use sp_core::{Get, H256, U256}; use sp_io::hashing::{keccak_256, sha2_256}; @@ -102,7 +102,8 @@ impl Pallet { ); // --- 8. Ensure the remove operation from the coldkey is a success. - let actual_burn_amount = Self::remove_balance_from_coldkey_account(&coldkey, registration_cost_as_balance)?; + let actual_burn_amount = + Self::remove_balance_from_coldkey_account(&coldkey, registration_cost_as_balance)?; // The burn occurs here. Self::burn_tokens(actual_burn_amount); @@ -431,14 +432,14 @@ impl Pallet { if neurons_n == 0 { return 0; // If there are no neurons in this network. } - + let current_block: u64 = Self::get_current_block_as_u64(); let immunity_period: u64 = Self::get_immunity_period(netuid) as u64; for neuron_uid_i in 0..neurons_n { let pruning_score: u16 = Self::get_pruning_score_for_uid(netuid, neuron_uid_i); let block_at_registration: u64 = Self::get_neuron_block_at_registration(netuid, neuron_uid_i); - + if min_score == pruning_score { if current_block - block_at_registration < immunity_period { //neuron is in immunity period @@ -730,7 +731,8 @@ impl Pallet { Self::can_remove_balance_from_coldkey_account(&coldkey, swap_cost_as_balance), Error::::NotEnoughBalance ); - let actual_burn_amount = Self::remove_balance_from_coldkey_account(&coldkey, swap_cost_as_balance)?; + let actual_burn_amount = + Self::remove_balance_from_coldkey_account(&coldkey, swap_cost_as_balance)?; Self::burn_tokens(actual_burn_amount); Owner::::remove(old_hotkey); diff --git a/pallets/subtensor/tests/staking.rs b/pallets/subtensor/tests/staking.rs index 052f168f2..da157cb5b 100644 --- a/pallets/subtensor/tests/staking.rs +++ b/pallets/subtensor/tests/staking.rs @@ -369,7 +369,6 @@ fn test_add_stake_under_limit() { new_test_ext(1).execute_with(|| { let hotkey_account_id = U256::from(561337); let coldkey_account_id = U256::from(61337); - let who: ::AccountId = hotkey_account_id; let netuid: u16 = 1; let start_nonce: u64 = 0; let tempo: u16 = 13; @@ -403,7 +402,6 @@ fn test_add_stake_rate_limit_exceeded() { new_test_ext(1).execute_with(|| { let hotkey_account_id = U256::from(561337); let coldkey_account_id = U256::from(61337); - let who: ::AccountId = hotkey_account_id; let netuid: u16 = 1; let start_nonce: u64 = 0; let tempo: u16 = 13; @@ -446,7 +444,6 @@ fn test_remove_stake_under_limit() { new_test_ext(1).execute_with(|| { let hotkey_account_id = U256::from(561337); let coldkey_account_id = U256::from(61337); - let who: ::AccountId = hotkey_account_id; let netuid: u16 = 1; let start_nonce: u64 = 0; let tempo: u16 = 13; @@ -482,7 +479,6 @@ fn test_remove_stake_rate_limit_exceeded() { new_test_ext(1).execute_with(|| { let hotkey_account_id = U256::from(561337); let coldkey_account_id = U256::from(61337); - let who: ::AccountId = hotkey_account_id; let netuid: u16 = 1; let start_nonce: u64 = 0; let tempo: u16 = 13;