18
18
normalize_hyperparameters ,
19
19
unlock_key ,
20
20
blocks_to_duration ,
21
- float_to_u64 ,
22
- float_to_u16 ,
23
21
json_console ,
22
+ string_to_u16 ,
23
+ string_to_u64 ,
24
24
)
25
25
26
26
if TYPE_CHECKING :
@@ -108,7 +108,7 @@ def type_converter_with_retry(type_, val, arg_name):
108
108
except ValueError :
109
109
return type_converter_with_retry (type_ , None , arg_name )
110
110
111
- arg_types = {"bool" : string_to_bool , "u16" : float_to_u16 , "u64" : float_to_u64 }
111
+ arg_types = {"bool" : string_to_bool , "u16" : string_to_u16 , "u64" : string_to_u64 }
112
112
arg_type_output = {"bool" : "bool" , "u16" : "float" , "u64" : "float" }
113
113
114
114
call_crafter = {"netuid" : netuid }
@@ -234,9 +234,9 @@ async def set_hyperparameter_extrinsic(
234
234
if isinstance (value , list ):
235
235
# Ensure that there are enough values for all non-netuid parameters
236
236
non_netuid_fields = [
237
- param [ "name" ]
237
+ pn_str
238
238
for param in extrinsic_params ["fields" ]
239
- if "netuid" not in param ["name" ]
239
+ if "netuid" not in ( pn_str := str ( param ["name" ]))
240
240
]
241
241
242
242
if len (value ) < len (non_netuid_fields ):
@@ -246,7 +246,7 @@ async def set_hyperparameter_extrinsic(
246
246
return False
247
247
248
248
call_params .update (
249
- {str ( name ) : val for name , val in zip (non_netuid_fields , value )}
249
+ {name : val for name , val in zip (non_netuid_fields , value )}
250
250
)
251
251
252
252
else :
0 commit comments