Skip to content
Open
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
3 changes: 3 additions & 0 deletions pallets/subtensor/src/subnets/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ impl<T: Config> Pallet<T> {
RegistrationsThisBlock::<T>::mutate(netuid, |val| val.saturating_inc());
Self::increase_rao_recycled(netuid, registration_cost.into());

// Record TAO inflow
Self::record_tao_inflow(netuid, actual_burn_amount);

// 12) event
log::debug!("NeuronRegistered( netuid:{netuid:?} uid:{neuron_uid:?} hotkey:{hotkey:?} )");
Self::deposit_event(Event::NeuronRegistered(netuid, neuron_uid, hotkey));
Expand Down
6 changes: 5 additions & 1 deletion pallets/subtensor/src/tests/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn test_registration_ok() {
mock::setup_reserves(netuid, DEFAULT_RESERVE.into(), DEFAULT_RESERVE.into());

// Make burn small and stable for this test.
SubtensorModule::set_burn(netuid, 1_000u64.into());
let burn = 1_000_u64;
SubtensorModule::set_burn(netuid, burn.into());

let hotkey = U256::from(1);
let coldkey = U256::from(667);
Expand Down Expand Up @@ -77,6 +78,9 @@ fn test_registration_ok() {
SubtensorModule::get_stake_for_uid_and_subnetwork(netuid, uid),
AlphaBalance::ZERO
);

// TAO inflow recorded
assert_eq!(SubnetTaoFlow::<Test>::get(netuid), burn as i64);
});
}

Expand Down
Loading