@@ -2492,6 +2492,28 @@ fn test_trim_to_max_allowed_uids() {
24922492 BlockAtRegistration :: < Test > :: set ( netuid, 6 , now) ;
24932493 BlockAtRegistration :: < Test > :: set ( netuid, 11 , now) ;
24942494
2495+ // Set some evm addresses
2496+ AssociatedEvmAddress :: < Test > :: insert (
2497+ netuid,
2498+ 6 ,
2499+ ( sp_core:: H160 :: from_slice ( b"0x12345678901234567890" ) , now) ,
2500+ ) ;
2501+ AssociatedEvmAddress :: < Test > :: insert (
2502+ netuid,
2503+ 11 ,
2504+ ( sp_core:: H160 :: from_slice ( b"0xA2345678901234567890" ) , now) ,
2505+ ) ;
2506+ AssociatedEvmAddress :: < Test > :: insert (
2507+ netuid,
2508+ 7 ,
2509+ ( sp_core:: H160 :: from_slice ( b"0xB2345678901234567890" ) , now) ,
2510+ ) ;
2511+ AssociatedEvmAddress :: < Test > :: insert (
2512+ netuid,
2513+ 14 ,
2514+ ( sp_core:: H160 :: from_slice ( b"0xC2345678901234567890" ) , now) ,
2515+ ) ;
2516+
24952517 // And some temporally immune uids
24962518 Keys :: < Test > :: insert ( netuid, 7 , sn_owner_hotkey1) ;
24972519 Uids :: < Test > :: insert ( netuid, sn_owner_hotkey1, 7 ) ;
@@ -2574,6 +2596,7 @@ fn test_trim_to_max_allowed_uids() {
25742596 for uid in new_max_n..max_n {
25752597 assert ! ( !Keys :: <Test >:: contains_key( netuid, uid) ) ;
25762598 assert ! ( !BlockAtRegistration :: <Test >:: contains_key( netuid, uid) ) ;
2599+ assert ! ( !AssociatedEvmAddress :: <Test >:: contains_key( netuid, uid) ) ;
25772600 for mecid in 0 ..mechanism_count. into ( ) {
25782601 let netuid_index =
25792602 SubtensorModule :: get_mechanism_storage_index ( netuid, MechId :: from ( mecid) ) ;
@@ -2631,6 +2654,7 @@ fn test_trim_to_max_allowed_uids() {
26312654 // Actual number of neurons on the network updated after trimming
26322655 assert_eq ! ( SubnetworkN :: <Test >:: get( netuid) , new_max_n) ;
26332656
2657+ // Uids match enumeration order
26342658 for i in 0 ..new_max_n. into ( ) {
26352659 let hotkey = Keys :: < Test > :: get ( netuid, i) ;
26362660 let uid = Uids :: < Test > :: get ( netuid, hotkey) ;
0 commit comments