From a722d3cfad9e99d3f20a1918a24eeb4fdec29009 Mon Sep 17 00:00:00 2001 From: Ayden Brewer Date: Tue, 19 Dec 2023 11:15:12 -0800 Subject: [PATCH] Add decoding to get_commitment helper function to return original value --- bittensor/subtensor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bittensor/subtensor.py b/bittensor/subtensor.py index 4553529a26..c26012e814 100644 --- a/bittensor/subtensor.py +++ b/bittensor/subtensor.py @@ -2125,7 +2125,11 @@ def get_commitment(self, netuid: int, uid: int, block: Optional[int] = None) -> metagraph = self.metagraph(netuid) hotkey = metagraph.hotkeys[uid] - return get_metadata(self, netuid, hotkey, block) + metadata = get_metadata(self, netuid, hotkey, block) + commitment = metadata["info"]["fields"][0] + hex_data = commitment[list(commitment.keys())[0]][2:] + + return bytes.fromhex(hex_data).decode() ######################## #### Standard Calls ####