Skip to content

Commit da19028

Browse files
fix: remove prepending the prefix twice (#154)
* fix: remove prepending the prefix twice * chore: ruff tweaks --------- Co-authored-by: Altynbek Orumbayev <altynbek.orumbayev@makerx.com.au>
1 parent 550a180 commit da19028

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/algokit_utils/applications/app_client.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,21 +452,16 @@ def get_map(map_name: str) -> dict[str, ABIValue]:
452452
if not box.name_raw.startswith(prefix):
453453
continue
454454

455-
encoded_key = prefix + box.name_raw
456-
base64_key = base64.b64encode(encoded_key).decode("utf-8")
457-
458455
try:
459456
key = get_abi_decoded_value(box.name_raw[len(prefix) :], metadata.key_type, self._app_spec.structs)
460457
value = get_abi_decoded_value(
461-
self._algorand.app.get_box_value(self._app_id, base64.b64decode(base64_key)),
458+
self._algorand.app.get_box_value(self._app_id, box.name_raw),
462459
metadata.value_type,
463460
self._app_spec.structs,
464461
)
465462
result[str(key)] = value
466463
except Exception as e:
467-
if "Failed to decode key" in str(e):
468-
raise ValueError(f"Failed to decode key {base64_key}") from e
469-
raise ValueError(f"Failed to decode value for key {base64_key}") from e
464+
raise ValueError(f"Failed to decode value for key {box.name_raw.decode('utf-8')}") from e
470465

471466
return result
472467

0 commit comments

Comments
 (0)