Skip to content

Commit a452e87

Browse files
authored
Merge pull request #677 from opentensor/clean_cold_swap
Clean cold swap + Metadatahash
2 parents af453f4 + 6f923c9 commit a452e87

File tree

4 files changed

+832
-382
lines changed

4 files changed

+832
-382
lines changed

pallets/subtensor/src/lib.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mod registration;
4444
mod root;
4545
mod serving;
4646
mod staking;
47-
mod swap;
47+
mod swap_coldkey;
4848
mod swap_hotkey;
4949
mod uids;
5050
mod utils;
@@ -726,7 +726,7 @@ pub mod pallet {
726726
#[pallet::storage] // --- MAP ( netuid ) --> last_mechanism_step_block
727727
pub type LastMechansimStepBlock<T> =
728728
StorageMap<_, Identity, u16, u64, ValueQuery, DefaultLastMechanismStepBlock<T>>;
729-
#[pallet::storage] // --- MAP ( netuid ) --> subnet_owner
729+
#[pallet::storage] // --- MAP ( netuid ) --> (cold) subnet_owner
730730
pub type SubnetOwner<T: Config> =
731731
StorageMap<_, Identity, u16, T::AccountId, ValueQuery, DefaultSubnetOwner<T>>;
732732
#[pallet::storage] // --- MAP ( netuid ) --> subnet_locked
@@ -801,10 +801,10 @@ pub mod pallet {
801801
#[pallet::storage] // --- ITEM ( tx_rate_limit )
802802
pub type TxDelegateTakeRateLimit<T> =
803803
StorageValue<_, u64, ValueQuery, DefaultTxDelegateTakeRateLimit<T>>;
804-
#[pallet::storage] // --- MAP ( key ) --> last_block
804+
#[pallet::storage] // --- MAP ( hotkey ) --> last_block
805805
pub type LastTxBlock<T: Config> =
806806
StorageMap<_, Identity, T::AccountId, u64, ValueQuery, DefaultLastTxBlock<T>>;
807-
#[pallet::storage] // --- MAP ( key ) --> last_block
807+
#[pallet::storage] // --- MAP ( hotkey ) --> last_block
808808
pub type LastTxBlockDelegateTake<T: Config> =
809809
StorageMap<_, Identity, T::AccountId, u64, ValueQuery, DefaultLastTxBlock<T>>;
810810

@@ -2065,17 +2065,17 @@ pub mod pallet {
20652065
}
20662066

20672067
/// The extrinsic for user to change its hotkey
2068-
///#[pallet::call_index(70)]
2069-
///#[pallet::weight((Weight::from_parts(1_940_000_000, 0)
2070-
///.saturating_add(T::DbWeight::get().reads(272))
2071-
///.saturating_add(T::DbWeight::get().writes(527)), DispatchClass::Operational, Pays::No))]
2072-
///pub fn swap_hotkey(
2073-
/// origin: OriginFor<T>,
2074-
/// hotkey: T::AccountId,
2075-
/// new_hotkey: T::AccountId,
2076-
///) -> DispatchResultWithPostInfo {
2077-
/// Self::do_swap_hotkey(origin, &hotkey, &new_hotkey)
2078-
///}
2068+
#[pallet::call_index(70)]
2069+
#[pallet::weight((Weight::from_parts(1_940_000_000, 0)
2070+
.saturating_add(T::DbWeight::get().reads(272))
2071+
.saturating_add(T::DbWeight::get().writes(527)), DispatchClass::Operational, Pays::No))]
2072+
pub fn swap_hotkey(
2073+
origin: OriginFor<T>,
2074+
hotkey: T::AccountId,
2075+
new_hotkey: T::AccountId,
2076+
) -> DispatchResultWithPostInfo {
2077+
Self::do_swap_hotkey(origin, &hotkey, &new_hotkey)
2078+
}
20792079

20802080
/// The extrinsic for user to change the coldkey associated with their account.
20812081
///

0 commit comments

Comments
 (0)