Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
andreea-popescu-reef committed Nov 14, 2024
1 parent ef3ce2d commit de94d68
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pallets/subtensor/src/subnets/uids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ impl<T: Config> Pallet<T> {
/// Resets the trust, emission, consensus, incentive, dividends of the neuron to default
pub fn clear_neuron(netuid: u16, neuron_uid: u16) {
let neuron_index: usize = neuron_uid.into();
Emission::<T>::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0));
Trust::<T>::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0));
Consensus::<T>::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0));
Incentive::<T>::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0));
Dividends::<T>::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0));
Self::set_element_at(&mut Emission::<T>::get(netuid), neuron_index, 0);
for storage in &mut [
&mut Trust::<T>::get(netuid),
&mut Trust::<T>::get(netuid),
&mut Consensus::<T>::get(netuid),
&mut Incentive::<T>::get(netuid),
&mut Dividends::<T>::get(netuid),
] {
Self::set_element_at(storage, neuron_index, 0);
}
}

/// Replace the neuron under this uid.
Expand Down

0 comments on commit de94d68

Please sign in to comment.