Skip to content

Commit

Permalink
fix comment index
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Aug 23, 2024
1 parent 039bb08 commit b4c1712
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pallets/subtensor/src/coinbase/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -993,28 +993,26 @@ impl<T: Config> Pallet<T> {
/// * 'NotSubnetOwner': If the caller does not own the specified subnet.
///
pub fn user_remove_network(coldkey: T::AccountId, netuid: u16) -> dispatch::DispatchResult {
// --- 1. Ensure the function caller is a signed user.

// --- 2. Ensure this subnet exists.
// --- 1. Ensure this subnet exists.
ensure!(
Self::if_subnet_exist(netuid),
Error::<T>::SubNetworkDoesNotExist
);

// --- 3. Ensure the caller owns this subnet.
// --- 2. Ensure the caller owns this subnet.
ensure!(
SubnetOwner::<T>::get(netuid) == coldkey,
Error::<T>::NotSubnetOwner
);

// --- 4. Explicitly erase the network and all its parameters.
// --- 2. Explicitly erase the network and all its parameters.
Self::remove_network(netuid);

// --- 5. Emit the NetworkRemoved event.
// --- 3. Emit the NetworkRemoved event.
log::debug!("NetworkRemoved( netuid:{:?} )", netuid);
Self::deposit_event(Event::NetworkRemoved(netuid));

// --- 6. Return success.
// --- 5. Return success.
Ok(())
}

Expand Down

0 comments on commit b4c1712

Please sign in to comment.