mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-27 01:48:17 +00:00
stellar - _xdr_read_address now returns string instead of bytes
This commit is contained in:
parent
cc6cc49999
commit
6afaa41616
@ -304,15 +304,15 @@ def _xdr_read_asset(unpacker):
|
|||||||
|
|
||||||
|
|
||||||
def _xdr_read_address(unpacker):
|
def _xdr_read_address(unpacker):
|
||||||
"""Reads a stellar address and returns the 32-byte
|
"""Reads a stellar address and returns the string representing the address
|
||||||
data representing the address
|
This method assumes the encoded address is a public address (starting with G)
|
||||||
"""
|
"""
|
||||||
# First 4 bytes are the address type
|
# First 4 bytes are the address type
|
||||||
address_type = unpacker.unpack_uint()
|
address_type = unpacker.unpack_uint()
|
||||||
if address_type != 0:
|
if address_type != 0:
|
||||||
raise ValueError("Unsupported address type")
|
raise ValueError("Unsupported address type")
|
||||||
|
|
||||||
return unpacker.unpack_fopaque(32)
|
return address_from_public_key(unpacker.unpack_fopaque(32))
|
||||||
|
|
||||||
|
|
||||||
def _crc16_checksum(bytes):
|
def _crc16_checksum(bytes):
|
||||||
|
Loading…
Reference in New Issue
Block a user