mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 14:28:07 +00:00
stellar: fix issue when signer_type = 0 (#463)
This commit is contained in:
parent
c737ddde67
commit
ee1a0fb8e0
@ -66,6 +66,8 @@ SIGN_TYPE_ACCOUNT = const(0)
|
||||
SIGN_TYPE_PRE_AUTH = const(1)
|
||||
SIGN_TYPE_HASH = const(2)
|
||||
|
||||
SIGN_TYPES = (SIGN_TYPE_ACCOUNT, SIGN_TYPE_HASH, SIGN_TYPE_PRE_AUTH)
|
||||
|
||||
|
||||
def get_op_code(msg) -> int:
|
||||
if msg.__qualname__ not in op_codes:
|
||||
|
@ -128,12 +128,13 @@ def write_set_options_op(w, msg: StellarSetOptionsOp):
|
||||
writers.write_string(w, msg.home_domain)
|
||||
|
||||
# signer
|
||||
writers.write_bool(w, bool(msg.signer_type))
|
||||
if msg.signer_type:
|
||||
# signer type
|
||||
if msg.signer_type in consts.SIGN_TYPES:
|
||||
writers.write_bool(w, True)
|
||||
writers.write_uint32(w, msg.signer_type)
|
||||
writers.write_bytes(w, msg.signer_key)
|
||||
writers.write_uint32(w, msg.signer_weight)
|
||||
else:
|
||||
writers.write_bool(w, False)
|
||||
|
||||
|
||||
def write_account(w, source_account: str):
|
||||
|
Loading…
Reference in New Issue
Block a user