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
7 changes: 7 additions & 0 deletions pallets/subtensor/src/migrations/migrate_rao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use alloc::string::String;
use frame_support::IterableStorageMap;
use frame_support::{traits::Get, weights::Weight};
use sp_runtime::format;
use substrate_fixed::types::I96F32;
use substrate_fixed::types::U64F64;

use super::*;
Expand Down Expand Up @@ -88,6 +89,12 @@ pub fn migrate_rao<T: Config>() -> Weight {

let remaining_lock = lock.saturating_sub(pool_initial_tao);
// Refund the owner for the remaining lock.
SubnetMovingPrice::<T>::insert(
netuid,
I96F32::from_num(EmissionValues::<T>::get(netuid))
.checked_div(I96F32::from_num(1_000_000_000))
.unwrap_or(I96F32::from_num(0.0)),
);
Pallet::<T>::add_balance_to_coldkey_account(&owner, remaining_lock);
SubnetLocked::<T>::insert(netuid, 0); // Clear lock amount.
SubnetTAO::<T>::insert(netuid, pool_initial_tao);
Expand Down
Loading
Loading