Skip to content

Commit

Permalink
fix error in merge
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Jan 10, 2025
1 parent 1c83232 commit db92036
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pallets/subtensor/src/subnets/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,14 +729,16 @@ impl<T: Config> Pallet<T> {
let neuron_uid = Self::get_uid_for_net_and_hotkey(netuid, &hotkey)?;
let current_block: u64 = Self::get_current_block_as_u64();

ensure!(
Self::check_rate_limit(netuid, neuron_uid, current_block),
Error::<T>::SettingWeightsTooFast
);
if !Self::get_commit_reveal_weights_enabled(netuid) {
ensure!(
Self::check_rate_limit(netuid, neuron_uid, current_block),
Error::<T>::SettingWeightsTooFast
);
}

// --- 8. Check that the neuron uid is an allowed validator permitted to set non-self weights.
ensure!(
!Self::get_commit_reveal_weights_enabled(netuid),
Self::check_validator_permit(netuid, neuron_uid, &uids, &values),
Error::<T>::NeuronNoValidatorPermit
);

Expand Down

0 comments on commit db92036

Please sign in to comment.