Skip to content

Commit 44e124f

Browse files
committed
Updates chain_data -> cls()
1 parent de235ac commit 44e124f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bittensor_cli/src/bittensor/chain_data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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"),
@@ -213,7 +213,7 @@ def _fix_decoded(cls, decoded: Any) -> "StakeInfo":
213213
drain = int(decoded.get("drain"))
214214
is_registered = bool(decoded.get("is_registered"))
215215

216-
return StakeInfo(
216+
return cls(
217217
hotkey,
218218
coldkey,
219219
netuid,
@@ -303,7 +303,7 @@ def _fix_decoded(cls, decoded: Any) -> "NeuronInfo":
303303
axon_info = decoded.get("axon_info", {})
304304
coldkey = decode_account_id(decoded.get("coldkey"))
305305
hotkey = decode_account_id(decoded.get("hotkey"))
306-
return NeuronInfo(
306+
return cls(
307307
hotkey=hotkey,
308308
coldkey=coldkey,
309309
uid=decoded.get("uid"),
@@ -565,7 +565,7 @@ class SubnetInfo(InfoBase):
565565

566566
@classmethod
567567
def _fix_decoded(cls, decoded: "SubnetInfo") -> "SubnetInfo":
568-
return SubnetInfo(
568+
return cls(
569569
netuid=decoded.get("netuid"),
570570
rho=decoded.get("rho"),
571571
kappa=decoded.get("kappa"),
@@ -604,7 +604,7 @@ class SubnetIdentity(InfoBase):
604604

605605
@classmethod
606606
def _fix_decoded(cls, decoded: dict) -> "SubnetIdentity":
607-
return SubnetIdentity(
607+
return cls(
608608
subnet_name=bytes(decoded["subnet_name"]).decode(),
609609
github_repo=bytes(decoded["github_repo"]).decode(),
610610
subnet_contact=bytes(decoded["subnet_contact"]).decode(),
@@ -838,7 +838,7 @@ class SubnetState(InfoBase):
838838
@classmethod
839839
def _fix_decoded(cls, decoded: Any) -> "SubnetState":
840840
netuid = decoded.get("netuid")
841-
return SubnetState(
841+
return cls(
842842
netuid=netuid,
843843
hotkeys=[decode_account_id(val) for val in decoded.get("hotkeys")],
844844
coldkeys=[decode_account_id(val) for val in decoded.get("coldkeys")],

0 commit comments

Comments
 (0)