Skip to content

Commit c628c41

Browse files
authored
Merge pull request #1738 from opentensor/update-doc-toggle-transfer
Update doc toggle transfer
2 parents 419fe5f + 074916e commit c628c41

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

pallets/admin-utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ pub mod pallet {
14151415
T::Grandpa::schedule_change(next_authorities, in_blocks, forced)
14161416
}
14171417

1418-
/// Enables or disables Liquid Alpha for a given subnet.
1418+
/// Enable or disable atomic alpha transfers for a given subnet.
14191419
///
14201420
/// # Parameters
14211421
/// - `origin`: The origin of the call, which must be the root account or subnet owner.

pallets/subtensor/src/staking/move_stake.rs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,28 @@ impl<T: Config> Pallet<T> {
7272
Ok(())
7373
}
7474

75+
/// Toggles the atomic alpha transfers for a specific subnet.
76+
///
77+
/// # Arguments
78+
/// * `netuid` - The network ID (subnet) for which the transfer functionality is being toggled.
79+
/// * `toggle` - A boolean value indicating whether to enable (true) or disable (false) transfers.
80+
///
81+
/// # Returns
82+
/// * `DispatchResult` - Indicates success or failure of the operation.
83+
///
84+
/// # Events
85+
/// Emits a `TransferToggle` event upon successful completion.
86+
pub fn toggle_transfer(netuid: u16, toggle: bool) -> dispatch::DispatchResult {
87+
TransferToggle::<T>::insert(netuid, toggle);
88+
log::debug!(
89+
"TransferToggle( netuid: {:?}, toggle: {:?} ) ",
90+
netuid,
91+
toggle
92+
);
93+
Self::deposit_event(Event::TransferToggle(netuid, toggle));
94+
Ok(())
95+
}
96+
7597
/// Transfers stake from one coldkey to another, optionally moving from one subnet to another,
7698
/// while keeping the same hotkey.
7799
///
@@ -97,16 +119,6 @@ impl<T: Config> Pallet<T> {
97119
///
98120
/// # Events
99121
/// Emits a `StakeTransferred` event upon successful completion of the transfer.
100-
pub fn toggle_transfer(netuid: u16, toggle: bool) -> dispatch::DispatchResult {
101-
TransferToggle::<T>::insert(netuid, toggle);
102-
log::debug!(
103-
"TransferToggle( netuid: {:?}, toggle: {:?} ) ",
104-
netuid,
105-
toggle
106-
);
107-
Self::deposit_event(Event::TransferToggle(netuid, toggle));
108-
Ok(())
109-
}
110122
pub fn do_transfer_stake(
111123
origin: T::RuntimeOrigin,
112124
destination_coldkey: T::AccountId,

0 commit comments

Comments
 (0)