@@ -2713,7 +2713,7 @@ fn test_trim_to_max_allowed_uids_too_many_immune() {
27132713 MaxRegistrationsPerBlock :: < Test > :: insert ( netuid, 256 ) ;
27142714 TargetRegistrationsPerInterval :: < Test > :: insert ( netuid, 256 ) ;
27152715 ImmuneOwnerUidsLimit :: < Test > :: insert ( netuid, 2 ) ;
2716- MinAllowedUids :: < Test > :: set ( netuid, 4 ) ;
2716+ MinAllowedUids :: < Test > :: set ( netuid, 2 ) ;
27172717
27182718 // Add 5 neurons
27192719 let max_n = 5 ;
@@ -2751,7 +2751,7 @@ fn test_trim_to_max_allowed_uids_too_many_immune() {
27512751 netuid,
27522752 4
27532753 ) ,
2754- pallet_subtensor:: Error :: <Test >:: InvalidValue
2754+ pallet_subtensor:: Error :: <Test >:: TrimmingWouldExceedMaxImmunePercentage
27552755 ) ;
27562756
27572757 // Try to trim to 3 UIDs - this should also fail because 4/3 > 80% immune (>= 80%)
@@ -2761,7 +2761,7 @@ fn test_trim_to_max_allowed_uids_too_many_immune() {
27612761 netuid,
27622762 3
27632763 ) ,
2764- pallet_subtensor:: Error :: <Test >:: InvalidValue
2764+ pallet_subtensor:: Error :: <Test >:: TrimmingWouldExceedMaxImmunePercentage
27652765 ) ;
27662766
27672767 // Now test a scenario where trimming should succeed
@@ -2773,10 +2773,6 @@ fn test_trim_to_max_allowed_uids_too_many_immune() {
27732773 Uids :: < Test > :: remove ( netuid, hotkey_to_remove) ;
27742774 BlockAtRegistration :: < Test > :: remove ( netuid, uid_to_remove) ;
27752775
2776- // Now we have 3 immune out of 4 total UIDs
2777- // Try to trim to 3 UIDs - this should succeed because 3/3 = 100% immune, but that's exactly 80%
2778- // Wait, 100% is > 80%, so this should fail. Let me test with a scenario where we have fewer immune UIDs
2779-
27802776 // Remove another immune UID to make it 2 immune out of 3 total
27812777 let uid_to_remove2 = 2 ;
27822778 let hotkey_to_remove2 = U256 :: from ( uid_to_remove2 * 1000 + 1000 ) ;
0 commit comments