Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions async_substrate_interface/async_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,12 +869,13 @@ async def decode_scale(
"""
if scale_bytes == b"\x00":
obj = None
if type_string == "scale_info::0": # Is an AccountId
# Decode AccountId bytes to SS58 address
return bytes.fromhex(ss58_decode(scale_bytes, SS58_FORMAT))
else:
await self._wait_for_registry(_attempt, _retries)
obj = decode_by_type_string(type_string, self.registry, scale_bytes)
if type_string == "scale_info::0": # Is an AccountId
# Decode AccountId bytes to SS58 address
return bytes.fromhex(ss58_decode(scale_bytes, SS58_FORMAT))
else:
await self._wait_for_registry(_attempt, _retries)
obj = decode_by_type_string(type_string, self.registry, scale_bytes)
if return_scale_obj:
return ScaleObj(obj)
else:
Expand Down
9 changes: 5 additions & 4 deletions async_substrate_interface/sync_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,12 @@ def decode_scale(

if scale_bytes == b"\x00":
obj = None
if type_string == "scale_info::0": # Is an AccountId
# Decode AccountId bytes to SS58 address
return bytes.fromhex(ss58_decode(scale_bytes, SS58_FORMAT))
else:
obj = decode_by_type_string(type_string, self.registry, scale_bytes)
if type_string == "scale_info::0": # Is an AccountId
# Decode AccountId bytes to SS58 address
return bytes.fromhex(ss58_decode(scale_bytes, SS58_FORMAT))
else:
obj = decode_by_type_string(type_string, self.registry, scale_bytes)
if return_scale_obj:
return ScaleObj(obj)
else:
Expand Down