We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14a8758 commit 4039b3bCopy full SHA for 4039b3b
pallets/admin-utils/src/tests/mod.rs
@@ -643,6 +643,18 @@ fn test_sudo_set_difficulty() {
643
to_be_set
644
));
645
assert_eq!(SubtensorModule::get_difficulty_as_u64(netuid), to_be_set);
646
+
647
+ // Test that SN owner can't set difficulty
648
+ pallet_subtensor::SubnetOwner::<Test>::insert(netuid, U256::from(1));
649
+ assert_eq!(
650
+ AdminUtils::sudo_set_difficulty(
651
+ <<Test as Config>::RuntimeOrigin>::signed(U256::from(1)),
652
+ netuid,
653
+ init_value
654
+ ),
655
+ Err(DispatchError::BadOrigin)
656
+ );
657
+ assert_eq!(SubtensorModule::get_difficulty_as_u64(netuid), to_be_set); // no change
658
});
659
}
660
0 commit comments