Skip to content

Commit 1f3c5f4

Browse files
authored
Merge pull request #54 from opentensor/fix/decoding-empty-change-data
Handles None change_data
2 parents a18befc + efe5588 commit 1f3c5f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ async def decode_scale(
892892
Returns:
893893
Decoded object
894894
"""
895+
if scale_bytes == b"":
896+
return None
895897
if type_string == "scale_info::0": # Is an AccountId
896898
# Decode AccountId bytes to SS58 address
897899
return ss58_encode(scale_bytes, SS58_FORMAT)
@@ -2230,7 +2232,7 @@ async def query_multi(
22302232
# Decode result for specified storage_key
22312233
storage_key = storage_key_map[change_storage_key]
22322234
if change_data is None:
2233-
change_data = b"\x00"
2235+
change_data = b""
22342236
else:
22352237
change_data = bytes.fromhex(change_data[2:])
22362238
result.append(

0 commit comments

Comments
 (0)