Skip to content

Commit

Permalink
Removed unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ala Shaabana committed Dec 12, 2023
1 parent 5027ec9 commit 8b0ad22
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions pallets/admin-utils/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,72 +286,6 @@ fn test_sudo_subnet_owner_cut() {
});
}

#[test]
fn test_sudo_validator_prune_len() {
new_test_ext().execute_with(|| {
let netuid: u16 = 1;
let to_be_set: u64 = 10;
add_network(netuid, 10, 0);
let init_value: u64 = SubtensorModule::get_validator_prune_len(netuid);
assert_eq!(
AdminUtils::sudo_set_validator_prune_len(
<<Test as Config>::RuntimeOrigin>::signed(U256::from(1)),
netuid,
to_be_set
),
Err(DispatchError::BadOrigin.into())
);
assert_eq!(
AdminUtils::sudo_set_validator_prune_len(
<<Test as Config>::RuntimeOrigin>::root(),
netuid + 1,
to_be_set
),
Err(Error::<Test>::NetworkDoesNotExist.into())
);
assert_eq!(SubtensorModule::get_validator_prune_len(netuid), init_value);
assert_ok!(AdminUtils::sudo_set_validator_prune_len(
<<Test as Config>::RuntimeOrigin>::root(),
netuid,
to_be_set
));
assert_eq!(SubtensorModule::get_validator_prune_len(netuid), to_be_set);
});
}

#[test]
fn test_sudo_set_scaling_law_power() {
new_test_ext().execute_with(|| {
let netuid: u16 = 1;
let to_be_set: u16 = 50;
add_network(netuid, 10, 0);
let init_value: u16 = SubtensorModule::get_scaling_law_power(netuid);
assert_eq!(
AdminUtils::sudo_set_scaling_law_power(
<<Test as Config>::RuntimeOrigin>::signed(U256::from(1)),
netuid,
to_be_set
),
Err(DispatchError::BadOrigin.into())
);
assert_eq!(
AdminUtils::sudo_set_scaling_law_power(
<<Test as Config>::RuntimeOrigin>::root(),
netuid + 1,
to_be_set
),
Err(Error::<Test>::NetworkDoesNotExist.into())
);
assert_eq!(SubtensorModule::get_scaling_law_power(netuid), init_value);
assert_ok!(AdminUtils::sudo_set_scaling_law_power(
<<Test as Config>::RuntimeOrigin>::root(),
netuid,
to_be_set
));
assert_eq!(SubtensorModule::get_scaling_law_power(netuid), to_be_set);
});
}

#[test]
fn test_sudo_set_max_weight_limit() {
new_test_ext().execute_with(|| {
Expand Down

0 comments on commit 8b0ad22

Please sign in to comment.