From 494796e59a305a00683ba55dab07bbc6526420b8 Mon Sep 17 00:00:00 2001 From: const Date: Sat, 13 Jul 2024 02:07:07 -0500 Subject: [PATCH] remove commented code --- pallets/subtensor/src/migration.rs | 50 ------------------------------ 1 file changed, 50 deletions(-) diff --git a/pallets/subtensor/src/migration.rs b/pallets/subtensor/src/migration.rs index 277c8e531..35b3c4260 100644 --- a/pallets/subtensor/src/migration.rs +++ b/pallets/subtensor/src/migration.rs @@ -603,53 +603,3 @@ pub fn migrate_populate_staking_hotkeys() -> Weight { Weight::zero() } } - -const LOG_TARGET_6: &str = "swapdelegate"; - -// const ALREADY_SWAPPED_COLDKEYS = []; - -// pub fn migrate_to_v6_swap_delegate_stake_also() -> Weight { -// let new_storage_version = 6; - -// // Check storage version -// let mut weight = T::DbWeight::get().reads(1); - -// // Grab current version -// let onchain_version = Pallet::::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::::iter() { -// // Get new coldkey -// let new_coldkey = ALREADY_SWAPPED_COLDKEYS.find(|x| x.0 == old_coldkey); -// // Grab hotkeys -// let staking_hotkeys = StakingHotkeys::::get(&old_coldkey); -// // Iterate over hotkeys -// for hotkey in staking_hotkeys { -// // Get the stake -// let stake = Stake::::get(&hotkey, &old_coldkey); -// Stake::::remove(&hotkey, &old_coldkey); - -// let old_stake = Stake::::get(&hotkey, &new_coldkey); -// // Add the stake to the new coldkey -// Stake::::insert(&hotkey, &new_coldkey, stake.saturating_add(old_stake)); -// weight.saturating_accrue(T::DbWeight::get().reads_writes(2, 2)); -// } - -// StakingHotkeys::::remove(&old_coldkey); -// weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); -// } - -// // Update storage version. -// StorageVersion::new(new_storage_version).put::>(); // 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() -// } -// }