We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f0a7cb commit e9b0051Copy full SHA for e9b0051
pallets/subtensor/src/swap/swap_hotkey.rs
@@ -437,6 +437,18 @@ impl<T: Config> Pallet<T> {
437
}
438
439
440
+ // 15. Swap SubnetOwnerHotkey
441
+ // SubnetOwnerHotkey( netuid ) --> hotkey -- the hotkey that is the owner of the subnet.
442
+ for netuid in Self::get_all_subnet_netuids() {
443
+ if let Ok(old_subnet_owner_hotkey) = SubnetOwnerHotkey::<T>::try_get(netuid) {
444
+ weight.saturating_accrue(T::DbWeight::get().reads(1));
445
+ if old_subnet_owner_hotkey == *old_hotkey {
446
+ SubnetOwnerHotkey::<T>::insert(netuid, new_hotkey);
447
+ weight.saturating_accrue(T::DbWeight::get().writes(1));
448
+ }
449
450
451
+
452
// Return successful after swapping all the relevant terms.
453
Ok(())
454
0 commit comments