Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed Jun 21, 2024
1 parent a027b5b commit 436fcf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallets/subtensor/src/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ impl<T: Config> Pallet<T> {
let mut writes = 0;
let stakes: Vec<(T::AccountId, u64)> = Stake::<T>::iter_prefix(old_hotkey).collect();
let stake_count = stakes.len() as u32;

for (coldkey, stake_amount) in stakes {
Stake::<T>::insert(new_hotkey, &coldkey, stake_amount);
writes += 1; // One write for insert
}

// Clear the prefix for the old hotkey after transferring all stakes
let _ = Stake::<T>::clear_prefix(old_hotkey, stake_count, None);
writes += 1; // One write for clear_prefix
Expand Down

0 comments on commit 436fcf4

Please sign in to comment.