From 636d21b18c74e2422423aefbca7054447ebfeca6 Mon Sep 17 00:00:00 2001 From: open-junius Date: Wed, 11 Jun 2025 09:29:07 +0800 Subject: [PATCH 1/3] update doc for toggle transfer function --- pallets/subtensor/src/staking/move_stake.rs | 32 ++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/pallets/subtensor/src/staking/move_stake.rs b/pallets/subtensor/src/staking/move_stake.rs index ef576f3607..a7af8af206 100644 --- a/pallets/subtensor/src/staking/move_stake.rs +++ b/pallets/subtensor/src/staking/move_stake.rs @@ -72,6 +72,28 @@ impl Pallet { Ok(()) } + /// Toggles the stake moving functionality for a specific subnet. + /// + /// # Arguments + /// * `netuid` - The network ID (subnet) for which the transfer functionality is being toggled. + /// * `toggle` - A boolean value indicating whether to enable (true) or disable (false) transfers. + /// + /// # Returns + /// * `DispatchResult` - Indicates success or failure of the operation. + /// + /// # Events + /// Emits a `TransferToggle` event upon successful completion. + pub fn toggle_transfer(netuid: u16, toggle: bool) -> dispatch::DispatchResult { + TransferToggle::::insert(netuid, toggle); + log::debug!( + "TransferToggle( netuid: {:?}, toggle: {:?} ) ", + netuid, + toggle + ); + Self::deposit_event(Event::TransferToggle(netuid, toggle)); + Ok(()) + } + /// Transfers stake from one coldkey to another, optionally moving from one subnet to another, /// while keeping the same hotkey. /// @@ -97,16 +119,6 @@ impl Pallet { /// /// # Events /// Emits a `StakeTransferred` event upon successful completion of the transfer. - pub fn toggle_transfer(netuid: u16, toggle: bool) -> dispatch::DispatchResult { - TransferToggle::::insert(netuid, toggle); - log::debug!( - "TransferToggle( netuid: {:?}, toggle: {:?} ) ", - netuid, - toggle - ); - Self::deposit_event(Event::TransferToggle(netuid, toggle)); - Ok(()) - } pub fn do_transfer_stake( origin: T::RuntimeOrigin, destination_coldkey: T::AccountId, From d38f635c1bcdcbd282e9041f8ac841ab2da54c0c Mon Sep 17 00:00:00 2001 From: open-junius Date: Wed, 11 Jun 2025 09:30:01 +0800 Subject: [PATCH 2/3] update doc --- pallets/admin-utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index 2b41539816..feac8a5560 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -1415,7 +1415,7 @@ pub mod pallet { T::Grandpa::schedule_change(next_authorities, in_blocks, forced) } - /// Enables or disables Liquid Alpha for a given subnet. + /// Enables or disables all stake moving related extrinsics for a given subnet. /// /// # Parameters /// - `origin`: The origin of the call, which must be the root account or subnet owner. From 074916e5d594f98d4fa54359416a9e804f3b6a12 Mon Sep 17 00:00:00 2001 From: open-junius Date: Wed, 11 Jun 2025 09:45:52 +0800 Subject: [PATCH 3/3] update doc --- pallets/admin-utils/src/lib.rs | 2 +- pallets/subtensor/src/staking/move_stake.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index feac8a5560..ec71e2faa4 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -1415,7 +1415,7 @@ pub mod pallet { T::Grandpa::schedule_change(next_authorities, in_blocks, forced) } - /// Enables or disables all stake moving related extrinsics for a given subnet. + /// Enable or disable atomic alpha transfers for a given subnet. /// /// # Parameters /// - `origin`: The origin of the call, which must be the root account or subnet owner. diff --git a/pallets/subtensor/src/staking/move_stake.rs b/pallets/subtensor/src/staking/move_stake.rs index a7af8af206..d743fb7a18 100644 --- a/pallets/subtensor/src/staking/move_stake.rs +++ b/pallets/subtensor/src/staking/move_stake.rs @@ -72,7 +72,7 @@ impl Pallet { Ok(()) } - /// Toggles the stake moving functionality for a specific subnet. + /// Toggles the atomic alpha transfers for a specific subnet. /// /// # Arguments /// * `netuid` - The network ID (subnet) for which the transfer functionality is being toggled.