@@ -27,7 +27,7 @@ pub struct SubnetInfo<T: Config> {
27
27
owner : T :: AccountId ,
28
28
}
29
29
30
- #[ freeze_struct( "65f931972fa13222 " ) ]
30
+ #[ freeze_struct( "c46dc4e2d4d9f8a3 " ) ]
31
31
#[ derive( Decode , Encode , PartialEq , Eq , Clone , Debug ) ]
32
32
pub struct SubnetInfov2 < T : Config > {
33
33
netuid : Compact < u16 > ,
@@ -48,7 +48,7 @@ pub struct SubnetInfov2<T: Config> {
48
48
emission_values : Compact < u64 > ,
49
49
burn : Compact < u64 > ,
50
50
owner : T :: AccountId ,
51
- identity : Option < SubnetIdentity > ,
51
+ identity : Option < SubnetIdentityV2 > ,
52
52
}
53
53
54
54
#[ freeze_struct( "dd91200554b75bc4" ) ]
@@ -198,7 +198,7 @@ impl<T: Config> Pallet<T> {
198
198
let network_modality = <NetworkModality < T > >:: get ( netuid) ;
199
199
let emission_values = Self :: get_emission_value ( netuid) ;
200
200
let burn: Compact < u64 > = Self :: get_burn_as_u64 ( netuid) . into ( ) ;
201
- let identity: Option < SubnetIdentity > = SubnetIdentities :: < T > :: get ( netuid) ;
201
+ let identity: Option < SubnetIdentityV2 > = SubnetIdentitiesV2 :: < T > :: get ( netuid) ;
202
202
203
203
// DEPRECATED
204
204
let network_connect: Vec < [ u16 ; 2 ] > = Vec :: < [ u16 ; 2 ] > :: new ( ) ;
@@ -250,78 +250,6 @@ impl<T: Config> Pallet<T> {
250
250
subnets_info
251
251
}
252
252
253
- pub fn get_subnet_info_v3 ( netuid : u16 ) -> Option < SubnetInfov3 < T > > {
254
- if !Self :: if_subnet_exist ( netuid) {
255
- return None ;
256
- }
257
-
258
- let rho = Self :: get_rho ( netuid) ;
259
- let kappa = Self :: get_kappa ( netuid) ;
260
- let difficulty: Compact < u64 > = Self :: get_difficulty_as_u64 ( netuid) . into ( ) ;
261
- let immunity_period = Self :: get_immunity_period ( netuid) ;
262
- let max_allowed_validators = Self :: get_max_allowed_validators ( netuid) ;
263
- let min_allowed_weights = Self :: get_min_allowed_weights ( netuid) ;
264
- let max_weights_limit = Self :: get_max_weight_limit ( netuid) ;
265
- let scaling_law_power = Self :: get_scaling_law_power ( netuid) ;
266
- let subnetwork_n = Self :: get_subnetwork_n ( netuid) ;
267
- let max_allowed_uids = Self :: get_max_allowed_uids ( netuid) ;
268
- let blocks_since_last_step = Self :: get_blocks_since_last_step ( netuid) ;
269
- let tempo = Self :: get_tempo ( netuid) ;
270
- let network_modality = <NetworkModality < T > >:: get ( netuid) ;
271
- let emission_values = Self :: get_emission_value ( netuid) ;
272
- let burn: Compact < u64 > = Self :: get_burn_as_u64 ( netuid) . into ( ) ;
273
- let identity: Option < SubnetIdentityV2 > = SubnetIdentitiesV2 :: < T > :: get ( netuid) ;
274
-
275
- // DEPRECATED
276
- let network_connect: Vec < [ u16 ; 2 ] > = Vec :: < [ u16 ; 2 ] > :: new ( ) ;
277
- // DEPRECATED for ( _netuid_, con_req) in < NetworkConnect<T> as IterableStorageDoubleMap<u16, u16, u16> >::iter_prefix(netuid) {
278
- // network_connect.push([_netuid_, con_req]);
279
- // }
280
-
281
- Some ( SubnetInfov3 {
282
- rho : rho. into ( ) ,
283
- kappa : kappa. into ( ) ,
284
- difficulty,
285
- immunity_period : immunity_period. into ( ) ,
286
- netuid : netuid. into ( ) ,
287
- max_allowed_validators : max_allowed_validators. into ( ) ,
288
- min_allowed_weights : min_allowed_weights. into ( ) ,
289
- max_weights_limit : max_weights_limit. into ( ) ,
290
- scaling_law_power : scaling_law_power. into ( ) ,
291
- subnetwork_n : subnetwork_n. into ( ) ,
292
- max_allowed_uids : max_allowed_uids. into ( ) ,
293
- blocks_since_last_step : blocks_since_last_step. into ( ) ,
294
- tempo : tempo. into ( ) ,
295
- network_modality : network_modality. into ( ) ,
296
- network_connect,
297
- emission_values : emission_values. into ( ) ,
298
- burn,
299
- owner : Self :: get_subnet_owner ( netuid) ,
300
- identity,
301
- } )
302
- }
303
-
304
- pub fn get_subnets_info_v3 ( ) -> Vec < Option < SubnetInfov3 < T > > > {
305
- let mut subnet_netuids = Vec :: < u16 > :: new ( ) ;
306
- let mut max_netuid: u16 = 0 ;
307
- for ( netuid, added) in <NetworksAdded < T > as IterableStorageMap < u16 , bool > >:: iter ( ) {
308
- if added {
309
- subnet_netuids. push ( netuid) ;
310
- if netuid > max_netuid {
311
- max_netuid = netuid;
312
- }
313
- }
314
- }
315
-
316
- let mut subnets_info = Vec :: < Option < SubnetInfov3 < T > > > :: new ( ) ;
317
- for netuid_ in 0 ..=max_netuid {
318
- if subnet_netuids. contains ( & netuid_) {
319
- subnets_info. push ( Self :: get_subnet_info_v3 ( netuid_) ) ;
320
- }
321
- }
322
-
323
- subnets_info
324
- }
325
253
pub fn get_subnet_hyperparams ( netuid : u16 ) -> Option < SubnetHyperparams > {
326
254
if !Self :: if_subnet_exist ( netuid) {
327
255
return None ;
0 commit comments