From c2ff20bf61450ee6147b5862e2b1aef49ae6b72e Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Sun, 17 Feb 2019 17:46:45 -0500 Subject: [PATCH] Use descriptor class in getkeypool --- hwilib/commands.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hwilib/commands.py b/hwilib/commands.py index 8b90cf1..4b66e24 100644 --- a/hwilib/commands.py +++ b/hwilib/commands.py @@ -139,15 +139,9 @@ def getkeypool(client, path, start, end, internal=False, keypool=False, account= import_data = [] this_import = {} - descriptor_open = 'pkh(' - descriptor_close = ')' - if wpkh == True: - descriptor_open = 'wpkh(' - elif sh_wpkh == True: - descriptor_open = 'sh(wpkh(' - descriptor_close = '))' + desc = Descriptor(master_fpr, path_base.replace('m', ''), base_key, path_suffix, client.is_testnet, sh_wpkh, wpkh) - this_import['desc'] = descriptor_open + '[' + master_fpr + path_base.replace('m', '') + ']' + base_key + path_suffix + descriptor_close + this_import['desc'] = desc.serialize() this_import['range'] = {'start': start, 'end': end} this_import['timestamp'] = 'now' this_import['internal'] = internal