Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild committed Jan 9, 2025
1 parent 2dd0606 commit d30f9d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ pub mod pallet {
#[pallet::storage] // --- DMAP ( netuid ) --> subnet_name | Returns the name of the subnet.
pub type SubnetName<T: Config> =
StorageMap<_, Identity, u16, Vec<u8>, ValueQuery, DefaultUnicodeVecU8<T>>;

/// ============================
/// ==== Global Parameters =====
/// ============================
Expand Down
5 changes: 2 additions & 3 deletions pallets/subtensor/src/migrations/migrate_rao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn migrate_rao<T: Config>() -> Weight {
weight = weight.saturating_add(T::DbWeight::get().reads_writes(netuids.len() as u64, 0));

// Set the Dynamic block.
DynamicBlock::<T>::set( Pallet::<T>::get_current_block_as_u64() );
DynamicBlock::<T>::set(Pallet::<T>::get_current_block_as_u64());

// Migrate all TAO to root.
Stake::<T>::iter().for_each(|(hotkey, coldkey, stake)| {
Expand Down Expand Up @@ -82,8 +82,7 @@ pub fn migrate_rao<T: Config>() -> Weight {
// Set the token symbol for this subnet using Self instead of Pallet::<T>
TokenSymbol::<T>::insert(netuid, Pallet::<T>::get_symbol_for_subnet(*netuid));
SubnetTAO::<T>::insert(netuid, initial_liquidity); // Set TAO to the lock.
TotalStakeAtDynamic::<T>::insert(netuid, 0);

TotalStakeAtDynamic::<T>::insert(netuid, 0);

if let Ok(owner_coldkey) = SubnetOwner::<T>::try_get(netuid) {
// Set Owner as the coldkey.
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/src/staking/stake_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ impl<T: Config> Pallet<T> {
///
/// Updates TaoIn, AlphaIn, and AlphaOut
pub fn swap_tao_for_alpha(netuid: u16, tao: u64) -> u64 {

// Step 1: Get the mechanism type for the subnet (0 for Stable, 1 for Dynamic)
let mechanism_id: u16 = SubnetMechanism::<T>::get(netuid);
// Step 2: Initialized vars.
Expand Down
2 changes: 1 addition & 1 deletion pallets/subtensor/src/subnets/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl<T: Config> Pallet<T> {
SubnetAlphaIn::<T>::insert(netuid_to_register, pool_initial_tao);
SubnetOwner::<T>::insert(netuid_to_register, coldkey.clone());
SubnetOwnerHotkey::<T>::insert(netuid_to_register, hotkey.clone());
TotalStakeAtDynamic::<T>::insert(netuid_to_register, TotalStake::<T>::get() );
TotalStakeAtDynamic::<T>::insert(netuid_to_register, TotalStake::<T>::get());

if actual_tao_lock_amount_less_pool_tao > 0 {
Self::burn_tokens(actual_tao_lock_amount_less_pool_tao);
Expand Down

0 comments on commit d30f9d1

Please sign in to comment.