Skip to content

Commit 3832d59

Browse files
committed
remove magic number
1 parent 5b54733 commit 3832d59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pallets/subtensor/src/subnets/mechanism.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ impl<T: Config> Pallet<T> {
9999
max_uids: u16,
100100
mechanism_count: MechId,
101101
) -> DispatchResult {
102+
let max_uids_over_all_mechanisms =
103+
max_uids.saturating_mul(u8::from(mechanism_count) as u16);
102104
ensure!(
103-
max_uids.saturating_mul(u8::from(mechanism_count) as u16) <= 256,
105+
max_uids_over_all_mechanisms <= T::DefaultMaxAllowedUids::get(),
104106
Error::<T>::TooManyUIDsPerMechanism
105107
);
106108
Ok(())

0 commit comments

Comments
 (0)