bittensor-cli 9.8.6__py3-none-any.whl → 9.8.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bittensor_cli/src/bittensor/utils.py +19 -14
- {bittensor_cli-9.8.6.dist-info → bittensor_cli-9.8.7.dist-info}/METADATA +1 -1
- {bittensor_cli-9.8.6.dist-info → bittensor_cli-9.8.7.dist-info}/RECORD +6 -6
- {bittensor_cli-9.8.6.dist-info → bittensor_cli-9.8.7.dist-info}/WHEEL +0 -0
- {bittensor_cli-9.8.6.dist-info → bittensor_cli-9.8.7.dist-info}/entry_points.txt +0 -0
- {bittensor_cli-9.8.6.dist-info → bittensor_cli-9.8.7.dist-info}/top_level.txt +0 -0
@@ -622,20 +622,23 @@ def decode_hex_identity_dict(info_dictionary) -> dict[str, Any]:
|
|
622
622
|
|
623
623
|
Examples:
|
624
624
|
input_dict = {
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
625
|
+
"name": {"value": "0x6a6f686e"},
|
626
|
+
"additional": [
|
627
|
+
{"data1": "0x64617461"},
|
628
|
+
("data2", "0x64617461")
|
629
|
+
]
|
630
|
+
}
|
630
631
|
decode_hex_identity_dict(input_dict)
|
631
|
-
{'name': 'john', 'additional': [('data', 'data')]}
|
632
|
+
{'name': 'john', 'additional': [('data1', 'data'), ('data2', 'data')]}
|
632
633
|
"""
|
633
634
|
|
634
|
-
def get_decoded(data: str) -> str:
|
635
|
+
def get_decoded(data: Optional[str]) -> str:
|
635
636
|
"""Decodes a hex-encoded string."""
|
637
|
+
if data is None:
|
638
|
+
return ""
|
636
639
|
try:
|
637
640
|
return hex_to_bytes(data).decode()
|
638
|
-
except UnicodeDecodeError:
|
641
|
+
except (UnicodeDecodeError, ValueError):
|
639
642
|
print(f"Could not decode: {key}: {item}")
|
640
643
|
|
641
644
|
for key, value in info_dictionary.items():
|
@@ -651,12 +654,14 @@ def decode_hex_identity_dict(info_dictionary) -> dict[str, Any]:
|
|
651
654
|
if key == "additional":
|
652
655
|
additional = []
|
653
656
|
for item in value:
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
)
|
659
|
-
|
657
|
+
if isinstance(item, dict):
|
658
|
+
for k, v in item.items():
|
659
|
+
additional.append((k, get_decoded(v)))
|
660
|
+
else:
|
661
|
+
if isinstance(item, (tuple, list)) and len(item) == 2:
|
662
|
+
k_, v = item
|
663
|
+
k = k_ if k_ is not None else ""
|
664
|
+
additional.append((k, get_decoded(v)))
|
660
665
|
info_dictionary[key] = additional
|
661
666
|
|
662
667
|
return info_dictionary
|
@@ -9,7 +9,7 @@ bittensor_cli/src/bittensor/chain_data.py,sha256=_GATOCacWMN2jRurzn3hffJiq_l7Azn
|
|
9
9
|
bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
|
10
10
|
bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
|
11
11
|
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=iPpM0mGsRwc7iejBI9oChpFd8DgEw13-Yb1fflQyCb8,61886
|
12
|
-
bittensor_cli/src/bittensor/utils.py,sha256=
|
12
|
+
bittensor_cli/src/bittensor/utils.py,sha256=WfxxQnekVy7nbB2jsPrRC4E7SFIvAjDJJjq3glhKMSc,48270
|
13
13
|
bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=7ybqpJ7-Z_PTgj4boCOFxgfjMBCHv0JE7MNpJzJmyDc,66360
|
15
15
|
bittensor_cli/src/bittensor/extrinsics/root.py,sha256=C9WPssL2HpNK8u_IFPPr8TrdFgbLPTfkbAYzalfmbRM,19188
|
@@ -44,8 +44,8 @@ bittensor_cli/src/commands/stake/remove.py,sha256=DX7yPXs5n8Gp3O_Fwz8cMYI8CAiRp1
|
|
44
44
|
bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
45
|
bittensor_cli/src/commands/subnets/price.py,sha256=akXkbilWjQYqTYvtOhXngX_cVkU0Mv-Gl3kjce6dtl0,21490
|
46
46
|
bittensor_cli/src/commands/subnets/subnets.py,sha256=ZeR7gxjtxi9eQdPLlIOmw3jDxDPnteppTPJ1-1y_TCs,94601
|
47
|
-
bittensor_cli-9.8.
|
48
|
-
bittensor_cli-9.8.
|
49
|
-
bittensor_cli-9.8.
|
50
|
-
bittensor_cli-9.8.
|
51
|
-
bittensor_cli-9.8.
|
47
|
+
bittensor_cli-9.8.7.dist-info/METADATA,sha256=PPTxAAdYJbLNkgqEtJHrr6nhlGBP-fVlbXiG5IRTEvA,6601
|
48
|
+
bittensor_cli-9.8.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
49
|
+
bittensor_cli-9.8.7.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
50
|
+
bittensor_cli-9.8.7.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
51
|
+
bittensor_cli-9.8.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|