From 6caca7a9c9cc7906fd0b4aa5a5c37675108f0e35 Mon Sep 17 00:00:00 2001 From: CiottiGiorgio Date: Thu, 17 Apr 2025 16:16:41 +0200 Subject: [PATCH] fix: remove prepending the prefix twice --- src/algokit_utils/applications/app_client.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/algokit_utils/applications/app_client.py b/src/algokit_utils/applications/app_client.py index 782e42e..c6652e8 100644 --- a/src/algokit_utils/applications/app_client.py +++ b/src/algokit_utils/applications/app_client.py @@ -449,21 +449,16 @@ def get_map(map_name: str) -> dict[str, ABIValue]: if not box.name_raw.startswith(prefix): continue - encoded_key = prefix + box.name_raw - base64_key = base64.b64encode(encoded_key).decode("utf-8") - try: key = get_abi_decoded_value(box.name_raw[len(prefix) :], metadata.key_type, self._app_spec.structs) value = get_abi_decoded_value( - self._algorand.app.get_box_value(self._app_id, base64.b64decode(base64_key)), + self._algorand.app.get_box_value(self._app_id, box.name_raw), metadata.value_type, self._app_spec.structs, ) result[str(key)] = value except Exception as e: - if "Failed to decode key" in str(e): - raise ValueError(f"Failed to decode key {base64_key}") from e - raise ValueError(f"Failed to decode value for key {base64_key}") from e + raise ValueError(f"Failed to decode value for key {box.name_raw.decode("utf-8")}") from e return result