File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ impl<T: Config> Pallet<T> {
367367 pub fn do_dissolve_network ( netuid : NetUid ) -> dispatch:: DispatchResult {
368368 // 1. --- The network exists?
369369 ensure ! (
370- Self :: if_subnet_exist( netuid) ,
370+ Self :: if_subnet_exist( netuid) && netuid != NetUid :: ROOT ,
371371 Error :: <T >:: SubNetworkDoesNotExist
372372 ) ;
373373
@@ -418,7 +418,7 @@ impl<T: Config> Pallet<T> {
418418 for ( uid_i, weights_i) in <Weights < T > as frame_support:: storage:: IterableStorageDoubleMap <
419419 NetUid ,
420420 u16 ,
421- sp_std :: vec :: Vec < ( u16 , u16 ) > ,
421+ Vec < ( u16 , u16 ) > ,
422422 > >:: iter_prefix ( NetUid :: ROOT )
423423 {
424424 let mut modified_weights = weights_i. clone ( ) ;
Original file line number Diff line number Diff line change @@ -1114,7 +1114,7 @@ fn prune_selection_complex_state_exhaustive() {
11141114 // Remove n5; now n6 (price=0) should be selected.
11151115 // This validates robustness to holes / non-contiguous netuids.
11161116 // ---------------------------------------------------------------------
1117- SubtensorModule :: remove_network ( n5) ;
1117+ SubtensorModule :: do_dissolve_network ( n5) . expect ( "Expected not to panic" ) ;
11181118 assert_eq ! (
11191119 SubtensorModule :: get_network_to_prune( ) ,
11201120 Some ( n6) ,
You can’t perform that action at this time.
0 commit comments