@@ -4183,9 +4183,11 @@ fn test_set_child_keys_empty_vector_clears_storage() {
41834183
41844184 // Initialize ChildKeys for `parent` with a non-empty vector
41854185 ChildKeys :: < Test > :: insert ( parent, netuid, vec ! [ ( u64 :: MAX , child) ] ) ;
4186+ ParentKeys :: < Test > :: insert ( child, netuid, vec ! [ ( u64 :: MAX , parent) ] ) ;
41864187
41874188 // Sanity: entry exists right now because we explicitly inserted it
41884189 assert ! ( ChildKeys :: <Test >:: contains_key( parent, netuid) ) ;
4190+ assert ! ( ParentKeys :: <Test >:: contains_key( child, netuid) ) ;
41894191
41904192 // Set children to empty
41914193 let empty_children: Vec < ( u64 , U256 ) > = Vec :: new ( ) ;
@@ -4194,8 +4196,10 @@ fn test_set_child_keys_empty_vector_clears_storage() {
41944196 // When the child vector is empty, we should NOT keep an empty vec in storage.
41954197 // The key must be fully removed (no entry), not just zero-length value.
41964198 assert ! ( !ChildKeys :: <Test >:: contains_key( parent, netuid) ) ;
4199+ assert ! ( !ParentKeys :: <Test >:: contains_key( child, netuid) ) ;
41974200
41984201 // `get` returns empty due to ValueQuery default, but presence is false.
41994202 assert ! ( ChildKeys :: <Test >:: get( parent, netuid) . is_empty( ) ) ;
4203+ assert ! ( ParentKeys :: <Test >:: get( child, netuid) . is_empty( ) ) ;
42004204 } ) ;
42014205}
0 commit comments