Skip to content

Commit

Permalink
Remove uids_match_values method from Pallet of pallet-subtensor
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-otf committed Dec 20, 2024
1 parent dc51187 commit 27f7ba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pallets/subtensor/src/coinbase/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ impl<T: Config> Pallet<T> {

// Check that the length of uid list and value list are equal for this network.
ensure!(
Self::uids_match_values(&uids, &values),
uids.len() == values.len(),
Error::<T>::WeightVecNotEqualSize
);

Expand Down
7 changes: 1 addition & 6 deletions pallets/subtensor/src/subnets/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl<T: Config> Pallet<T> {

// --- 2. Check that the length of uid list and value list are equal for this network.
ensure!(
Self::uids_match_values(&uids, &values),
uids.len() == values.len(),
Error::<T>::WeightVecNotEqualSize
);

Expand Down Expand Up @@ -939,11 +939,6 @@ impl<T: Config> Pallet<T> {
false
}

/// Returns true if the passed uids have the same length of the passed values.
pub fn uids_match_values(uids: &[u16], values: &[u16]) -> bool {
uids.len() == values.len()
}

/// Returns true if the items contain duplicates.
pub fn has_duplicate_uids(items: &[u16]) -> bool {
let mut parsed: Vec<u16> = Vec::new();
Expand Down

0 comments on commit 27f7ba4

Please sign in to comment.