1
0
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:
Tomas Susanka 2019-01-17 13:42:22 +01:00
parent c737ddde67
commit ee1a0fb8e0
2 changed files with 6 additions and 3 deletions

View File

@ -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:

View File

@ -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):