@@ -868,75 +868,4 @@ impl<T: Config> Pallet<T> {
868868 Self :: add_balance_to_coldkey_account ( & delegate_coldkey_i, stake_i) ;
869869 }
870870 }
871-
872- // pub fn x( coldkey_a: &T::AccountId, coldkey_b: &T::AccountId ) -> Weight {
873- // let mut weight = frame_support::weights::Weight::from_parts(0, 0);
874-
875- // // Get the hotkeys associated with coldkey_a.
876- // let coldkey_a_hotkeys: Vec<T::AccountId> = StakingHotkeys::<T>::get( &coldkey_a );
877- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 0));
878-
879- // // Iterate over all the hotkeys associated with this coldkey
880- // for hotkey_i in coldkey_a_hotkeys.iter() {
881-
882- // // Get the current stake from coldkey_a to hotkey_i.
883- // let all_current_stake_i: u64 = Self::get_stake_for_coldkey_and_hotkey( &coldkey_a, &hotkey_i );
884- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 0));
885-
886- // // We remove the balance from the hotkey acount equal to all of it.
887- // Self::decrease_stake_on_coldkey_hotkey_account( &coldkey_a, &hotkey_i, all_current_stake_i );
888- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(0, 4));
889-
890- // // We add the balance to the coldkey. If the above fails we will not credit this coldkey.
891- // Self::add_balance_to_coldkey_account( &coldkey_a, all_current_stake_i );
892- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2));
893- // }
894- // Unstake all delegate stake make by this coldkey to non-owned hotkeys
895- // let staking_hotkeys = StakingHotkeys::<T>::get(¤t_coldkey);
896-
897- // // iterate over all staking hotkeys.
898- // for hotkey in staking_hotkeys {
899- // // Get the current stake
900- // let current_stake: u64 =
901- // Self::get_stake_for_coldkey_and_hotkey(¤t_coldkey, &hotkey);
902-
903- // // Unstake all balance if there's any stake
904- // if current_stake > 0 {
905- // Self::do_remove_stake(
906- // RawOrigin::Signed(current_coldkey.clone()).into(),
907- // hotkey.clone(),
908- // current_stake,
909- // )?;
910- // }
911- // }
912-
913- // let total_balance = Self::get_coldkey_balance(¤t_coldkey);
914- // log::info!("Total Bank Balance: {:?}", total_balance);
915-
916- // // Get the total balance here.
917- // let total_balance = Self::get_coldkey_balance( &coldkey_a );
918- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 0));
919-
920- // if !total_balance.is_zero() {
921- // // Attempt to transfer the entire total balance to coldkey_b.
922- // let _ = T::Currency::transfer(
923- // coldkey_a,
924- // coldkey_b,
925- // total_balance,
926- // Preservation::Expendable,
927- // );
928- // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1));
929- // }
930-
931- // // Emit event
932- // Self::deposit_event(
933- // Event::AllBalanceUnstakedAndTransferredToNewColdkey {
934- // current_coldkey: coldkey_a.clone(),
935- // new_coldkey: coldkey_b.clone(),
936- // total_balance
937- // }
938- // );
939-
940- // weight
941- // }
942871}
0 commit comments