|
1 | 1 | use super::*; |
2 | | -use crate::MIN_BALANCE_TO_PERFORM_COLDKEY_SWAP; |
3 | | -use frame_support::traits::fungible::Mutate; |
4 | | -use frame_support::traits::tokens::Preservation; |
5 | | -use frame_support::{storage::IterableStorageDoubleMap, weights::Weight}; |
6 | | -use sp_core::{Get, U256}; |
| 2 | +use frame_support::weights::Weight; |
| 3 | +use sp_core::Get; |
7 | 4 |
|
8 | 5 | impl<T: Config> Pallet<T> { |
9 | 6 | /// Swaps the hotkey of a coldkey account. |
@@ -86,7 +83,7 @@ impl<T: Config> Pallet<T> { |
86 | 83 | Self::burn_tokens(actual_burn_amount); |
87 | 84 |
|
88 | 85 | // Perform the hotkey swap |
89 | | - Self::perform_hotkey_swap(old_hotkey, new_hotkey, &coldkey, &mut weight); |
| 86 | + let _ = Self::perform_hotkey_swap(old_hotkey, new_hotkey, &coldkey, &mut weight); |
90 | 87 |
|
91 | 88 | // Update the last transaction block for the coldkey |
92 | 89 | Self::set_last_tx_block(&coldkey, block); |
@@ -143,10 +140,9 @@ impl<T: Config> Pallet<T> { |
143 | 140 |
|
144 | 141 | // Swap LastTxBlock |
145 | 142 | // LastTxBlock( hotkey ) --> u64 -- the last transaction block for the hotkey. |
146 | | - let old_last_tx_block: u64 = LastTxBlock::<T>::get( old_hotkey ); |
147 | 143 | LastTxBlock::<T>::remove( old_hotkey ); |
148 | 144 | LastTxBlock::<T>::insert( new_hotkey, Self::get_current_block_as_u64() ); |
149 | | - weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 2)); |
| 145 | + weight.saturating_accrue(T::DbWeight::get().reads_writes(0, 2)); |
150 | 146 |
|
151 | 147 | // Swap LastTxBlockDelegateTake |
152 | 148 | // LastTxBlockDelegateTake( hotkey ) --> u64 -- the last transaction block for the hotkey delegate take. |
|
0 commit comments