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(
892
892
Returns:
893
893
Decoded object
894
894
"""
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 )
897
898
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 )
904
901
if return_scale_obj :
905
902
return ScaleObj (obj )
906
903
else :
Original file line number Diff line number Diff line change @@ -652,15 +652,11 @@ def decode_scale(
652
652
Returns:
653
653
Decoded object
654
654
"""
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 )
658
658
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 )
664
660
if return_scale_obj :
665
661
return ScaleObj (obj )
666
662
else :
You can’t perform that action at this time.
0 commit comments