diff --git a/pallets/admin-utils/src/tests/mod.rs b/pallets/admin-utils/src/tests/mod.rs index f52b29bcf..1ca556576 100644 --- a/pallets/admin-utils/src/tests/mod.rs +++ b/pallets/admin-utils/src/tests/mod.rs @@ -291,7 +291,7 @@ fn test_sudo_set_max_weight_limit() { let netuid: u16 = 1; let to_be_set: u16 = 10; add_network(netuid, 10); - let init_value: u16 = SubtensorModule::get_max_weight_limit(netuid); + let init_value: u16 = MaxWeightsLimit::::get(netuid); assert_eq!( AdminUtils::sudo_set_max_weight_limit( <::RuntimeOrigin>::signed(U256::from(1)), @@ -308,13 +308,13 @@ fn test_sudo_set_max_weight_limit() { ), Err(Error::::SubnetDoesNotExist.into()) ); - assert_eq!(SubtensorModule::get_max_weight_limit(netuid), init_value); + assert_eq!(MaxWeightsLimit::::get(netuid), init_value); assert_ok!(AdminUtils::sudo_set_max_weight_limit( <::RuntimeOrigin>::root(), netuid, to_be_set )); - assert_eq!(SubtensorModule::get_max_weight_limit(netuid), to_be_set); + assert_eq!(MaxWeightsLimit::::get(netuid), to_be_set); }); } diff --git a/pallets/subtensor/src/rpc_info/subnet_info.rs b/pallets/subtensor/src/rpc_info/subnet_info.rs index 15f6d35dd..337d86d40 100644 --- a/pallets/subtensor/src/rpc_info/subnet_info.rs +++ b/pallets/subtensor/src/rpc_info/subnet_info.rs @@ -95,7 +95,7 @@ impl Pallet { let immunity_period = ImmunityPeriod::::get(netuid); let max_allowed_validators = MaxAllowedValidators::::get(netuid); let min_allowed_weights = Self::get_min_allowed_weights(netuid); - let max_weights_limit = Self::get_max_weight_limit(netuid); + let max_weights_limit = MaxWeightsLimit::::get(netuid); let scaling_law_power = Self::get_scaling_law_power(netuid); let subnetwork_n = SubnetworkN::::get(netuid); let max_allowed_uids = MaxAllowedUids::::get(netuid); @@ -165,7 +165,7 @@ impl Pallet { let immunity_period = ImmunityPeriod::::get(netuid); let max_allowed_validators = MaxAllowedValidators::::get(netuid); let min_allowed_weights = Self::get_min_allowed_weights(netuid); - let max_weights_limit = Self::get_max_weight_limit(netuid); + let max_weights_limit = MaxWeightsLimit::::get(netuid); let scaling_law_power = Self::get_scaling_law_power(netuid); let subnetwork_n = SubnetworkN::::get(netuid); let max_allowed_uids = MaxAllowedUids::::get(netuid); @@ -234,7 +234,7 @@ impl Pallet { let kappa = Kappa::::get(netuid); let immunity_period = ImmunityPeriod::::get(netuid); let min_allowed_weights = Self::get_min_allowed_weights(netuid); - let max_weights_limit = Self::get_max_weight_limit(netuid); + let max_weights_limit = MaxWeightsLimit::::get(netuid); let tempo = Self::get_tempo(netuid); let min_difficulty = Self::get_min_difficulty(netuid); let max_difficulty = MaxDifficulty::::get(netuid); diff --git a/pallets/subtensor/src/subnets/weights.rs b/pallets/subtensor/src/subnets/weights.rs index 53d2c596e..aba5ac4a4 100644 --- a/pallets/subtensor/src/subnets/weights.rs +++ b/pallets/subtensor/src/subnets/weights.rs @@ -1004,7 +1004,7 @@ impl Pallet { } // If the max weight limit it u16 max, return true. - let max_weight_limit: u16 = Self::get_max_weight_limit(netuid); + let max_weight_limit: u16 = MaxWeightsLimit::::get(netuid); if max_weight_limit == u16::MAX { return true; } diff --git a/pallets/subtensor/src/utils/misc.rs b/pallets/subtensor/src/utils/misc.rs index 158ee5e22..df2676c22 100644 --- a/pallets/subtensor/src/utils/misc.rs +++ b/pallets/subtensor/src/utils/misc.rs @@ -379,9 +379,6 @@ impl Pallet { Self::deposit_event(Event::ScalingLawPowerSet(netuid, scaling_law_power)); } - pub fn get_max_weight_limit(netuid: u16) -> u16 { - MaxWeightsLimit::::get(netuid) - } pub fn set_max_weight_limit(netuid: u16, max_weight_limit: u16) { MaxWeightsLimit::::insert(netuid, max_weight_limit); Self::deposit_event(Event::MaxWeightLimitSet(netuid, max_weight_limit));