@@ -156,7 +156,7 @@ class SubnetHyperparameters(InfoBase):
156156 def _fix_decoded (
157157 cls , decoded : Union [dict , "SubnetHyperparameters" ]
158158 ) -> "SubnetHyperparameters" :
159- return SubnetHyperparameters (
159+ return cls (
160160 rho = decoded .get ("rho" ),
161161 kappa = decoded .get ("kappa" ),
162162 immunity_period = decoded .get ("immunity_period" ),
@@ -197,6 +197,7 @@ class StakeInfo(InfoBase):
197197 stake : Balance # Stake for the hotkey-coldkey pair
198198 locked : Balance # Stake which is locked.
199199 emission : Balance # Emission for the hotkey-coldkey pair
200+ tao_emission : Balance # TAO emission for the hotkey-coldkey pair
200201 drain : int
201202 is_registered : bool
202203
@@ -208,11 +209,20 @@ def _fix_decoded(cls, decoded: Any) -> "StakeInfo":
208209 stake = Balance .from_rao (decoded .get ("stake" )).set_unit (netuid )
209210 locked = Balance .from_rao (decoded .get ("locked" )).set_unit (netuid )
210211 emission = Balance .from_rao (decoded .get ("emission" )).set_unit (netuid )
212+ tao_emission = Balance .from_rao (decoded .get ("tao_emission" ))
211213 drain = int (decoded .get ("drain" ))
212214 is_registered = bool (decoded .get ("is_registered" ))
213215
214- return StakeInfo (
215- hotkey , coldkey , netuid , stake , locked , emission , drain , is_registered
216+ return cls (
217+ hotkey ,
218+ coldkey ,
219+ netuid ,
220+ stake ,
221+ locked ,
222+ emission ,
223+ tao_emission ,
224+ drain ,
225+ is_registered ,
216226 )
217227
218228
@@ -293,7 +303,7 @@ def _fix_decoded(cls, decoded: Any) -> "NeuronInfo":
293303 axon_info = decoded .get ("axon_info" , {})
294304 coldkey = decode_account_id (decoded .get ("coldkey" ))
295305 hotkey = decode_account_id (decoded .get ("hotkey" ))
296- return NeuronInfo (
306+ return cls (
297307 hotkey = hotkey ,
298308 coldkey = coldkey ,
299309 uid = decoded .get ("uid" ),
@@ -555,7 +565,7 @@ class SubnetInfo(InfoBase):
555565
556566 @classmethod
557567 def _fix_decoded (cls , decoded : "SubnetInfo" ) -> "SubnetInfo" :
558- return SubnetInfo (
568+ return cls (
559569 netuid = decoded .get ("netuid" ),
560570 rho = decoded .get ("rho" ),
561571 kappa = decoded .get ("kappa" ),
@@ -594,7 +604,7 @@ class SubnetIdentity(InfoBase):
594604
595605 @classmethod
596606 def _fix_decoded (cls , decoded : dict ) -> "SubnetIdentity" :
597- return SubnetIdentity (
607+ return cls (
598608 subnet_name = bytes (decoded ["subnet_name" ]).decode (),
599609 github_repo = bytes (decoded ["github_repo" ]).decode (),
600610 subnet_contact = bytes (decoded ["subnet_contact" ]).decode (),
@@ -828,7 +838,7 @@ class SubnetState(InfoBase):
828838 @classmethod
829839 def _fix_decoded (cls , decoded : Any ) -> "SubnetState" :
830840 netuid = decoded .get ("netuid" )
831- return SubnetState (
841+ return cls (
832842 netuid = netuid ,
833843 hotkeys = [decode_account_id (val ) for val in decoded .get ("hotkeys" )],
834844 coldkeys = [decode_account_id (val ) for val in decoded .get ("coldkeys" )],
0 commit comments