From 5005a61eafff57dcd6a1a24e255da6ec28a19194 Mon Sep 17 00:00:00 2001 From: matejcik Date: Mon, 26 Oct 2020 16:04:41 +0100 Subject: [PATCH] fix(python): update trezorctl multisig feature to new API --- python/src/trezorlib/cli/btc.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python/src/trezorlib/cli/btc.py b/python/src/trezorlib/cli/btc.py index 7ecfa6eed..80f35bc6b 100644 --- a/python/src/trezorlib/cli/btc.py +++ b/python/src/trezorlib/cli/btc.py @@ -52,16 +52,21 @@ XpubStruct = c.Struct( def xpub_deserialize(xpubstr): xpub_bytes = tools.b58check_decode(xpubstr) data = XpubStruct.parse(xpub_bytes) + if data.key[0] == 0: + private_key = data.key[1:] + public_key = None + else: + public_key = data.key + private_key = None + node = messages.HDNodeType( depth=data.depth, fingerprint=data.fingerprint, child_num=data.child_num, chain_code=data.chain_code, + public_key=public_key, + private_key=private_key, ) - if data.key[0] == 0: - node.private_key = data.key[1:] - else: - node.public_key = data.key return data.version, node