Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// 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.
Expand Down
32 changes: 22 additions & 10 deletions pallets/subtensor/src/staking/move_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ impl<T: Config> Pallet<T> {
Ok(())
}

/// Toggles the atomic alpha transfers 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::<T>::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.
///
Expand All @@ -97,16 +119,6 @@ impl<T: Config> Pallet<T> {
///
/// # Events
/// Emits a `StakeTransferred` event upon successful completion of the transfer.
pub fn toggle_transfer(netuid: u16, toggle: bool) -> dispatch::DispatchResult {
TransferToggle::<T>::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,
Expand Down
Loading