diff --git a/pallets/subtensor/src/subnets/uids.rs b/pallets/subtensor/src/subnets/uids.rs index f48cd3b50..9de108697 100644 --- a/pallets/subtensor/src/subnets/uids.rs +++ b/pallets/subtensor/src/subnets/uids.rs @@ -19,11 +19,16 @@ impl Pallet { /// 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::::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0)); - Trust::::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0)); - Consensus::::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0)); - Incentive::::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0)); - Dividends::::mutate(netuid, |v| Self::set_element_at(v, neuron_index, 0)); + Self::set_element_at(&mut Emission::::get(netuid), neuron_index, 0); + for storage in &mut [ + &mut Trust::::get(netuid), + &mut Trust::::get(netuid), + &mut Consensus::::get(netuid), + &mut Incentive::::get(netuid), + &mut Dividends::::get(netuid), + ] { + Self::set_element_at(storage, neuron_index, 0); + } } /// Replace the neuron under this uid.