Skip to content

Commit

Permalink
remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
const authored and const committed Jul 13, 2024
1 parent fc245f8 commit 494796e
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions pallets/subtensor/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,53 +603,3 @@ pub fn migrate_populate_staking_hotkeys<T: Config>() -> Weight {
Weight::zero()
}
}

const LOG_TARGET_6: &str = "swapdelegate";

// const ALREADY_SWAPPED_COLDKEYS = [];

// pub fn migrate_to_v6_swap_delegate_stake_also<T: Config>() -> Weight {
// let new_storage_version = 6;

// // Check storage version
// let mut weight = T::DbWeight::get().reads(1);

// // Grab current version
// let onchain_version = Pallet::<T>::on_chain_storage_version();

// // Only runs if we haven't already updated version past above new_storage_version.
// if onchain_version < new_storage_version {
// info!(target: LOG_TARGET_6, ">>> Swapping delegate stake for an already-swapped coldkey {:?}", onchain_version);

// for (old_coldkey, _) in ColdkeyArbitrationBlock::<T>::iter() {
// // Get new coldkey
// let new_coldkey = ALREADY_SWAPPED_COLDKEYS.find(|x| x.0 == old_coldkey);
// // Grab hotkeys
// let staking_hotkeys = StakingHotkeys::<T>::get(&old_coldkey);
// // Iterate over hotkeys
// for hotkey in staking_hotkeys {
// // Get the stake
// let stake = Stake::<T>::get(&hotkey, &old_coldkey);
// Stake::<T>::remove(&hotkey, &old_coldkey);

// let old_stake = Stake::<T>::get(&hotkey, &new_coldkey);
// // Add the stake to the new coldkey
// Stake::<T>::insert(&hotkey, &new_coldkey, stake.saturating_add(old_stake));
// weight.saturating_accrue(T::DbWeight::get().reads_writes(2, 2));
// }

// StakingHotkeys::<T>::remove(&old_coldkey);
// weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1));
// }

// // Update storage version.
// StorageVersion::new(new_storage_version).put::<Pallet<T>>(); // Update to version so we don't run this again.
// // One write to storage version
// weight.saturating_accrue(T::DbWeight::get().writes(1));

// weight
// } else {
// info!(target: LOG_TARGET_6, "Migration to v6 already done!");
// Weight::zero()
// }
// }

0 comments on commit 494796e

Please sign in to comment.