File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed
async_substrate_interface Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -892,15 +892,12 @@ async def decode_scale(
892892 Returns:
893893 Decoded object
894894 """
895- if scale_bytes == b"\x00 " :
896- obj = None
895+ if type_string == "scale_info::0" : # Is an AccountId
896+ # Decode AccountId bytes to SS58 address
897+ return ss58_encode (scale_bytes , SS58_FORMAT )
897898 else :
898- if type_string == "scale_info::0" : # Is an AccountId
899- # Decode AccountId bytes to SS58 address
900- return ss58_encode (scale_bytes , SS58_FORMAT )
901- else :
902- await self ._wait_for_registry (_attempt , _retries )
903- obj = decode_by_type_string (type_string , self .registry , scale_bytes )
899+ await self ._wait_for_registry (_attempt , _retries )
900+ obj = decode_by_type_string (type_string , self .registry , scale_bytes )
904901 if return_scale_obj :
905902 return ScaleObj (obj )
906903 else :
Original file line number Diff line number Diff line change @@ -652,15 +652,11 @@ def decode_scale(
652652 Returns:
653653 Decoded object
654654 """
655-
656- if scale_bytes == b" \x00 " :
657- obj = None
655+ if type_string == "scale_info::0" : # Is an AccountId
656+ # Decode AccountId bytes to SS58 address
657+ return ss58_encode ( scale_bytes , SS58_FORMAT )
658658 else :
659- if type_string == "scale_info::0" : # Is an AccountId
660- # Decode AccountId bytes to SS58 address
661- return ss58_encode (scale_bytes , SS58_FORMAT )
662- else :
663- obj = decode_by_type_string (type_string , self .registry , scale_bytes )
659+ obj = decode_by_type_string (type_string , self .registry , scale_bytes )
664660 if return_scale_obj :
665661 return ScaleObj (obj )
666662 else :
You can’t perform that action at this time.
0 commit comments