Skip to content

Commit c46628d

Browse files
committed
fixes #1125; add pending CHK to hk swap
1 parent a4c49e3 commit c46628d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pallets/subtensor/src/swap/swap_hotkey.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,15 @@ impl<T: Config> Pallet<T> {
403403
}
404404
}
405405

406-
// 14. Swap Stake Delta for all coldkeys.
407-
// DEPRECATED
406+
// 14. Swap PendingChildKeys.
407+
// PendingChildKeys( netuid, parent ) --> Vec<(proportion,child), cool_down_block>
408+
for netuid in Self::get_all_subnet_netuids() {
409+
if PendingChildKeys::<T>::contains_key(netuid, old_hotkey) {
410+
let (children, cool_down_block) = PendingChildKeys::<T>::get(netuid, old_hotkey);
411+
PendingChildKeys::<T>::remove(netuid, old_hotkey);
412+
PendingChildKeys::<T>::insert(netuid, new_hotkey, (children, cool_down_block));
413+
}
414+
}
408415

409416
// Return successful after swapping all the relevant terms.
410417
Ok(())

0 commit comments

Comments
 (0)