def get_session_info_trezor(get_public_node_fun, hw_session: HwSessionInfo, hw_client): nonlocal hw_type def call_get_public_node(ctrl, get_public_node_fun, path_n): pk = get_public_node_fun(path_n).node.public_key return pk path = fix_utils.get_default_bip32_base_path( hw_session.app_config.fix_network) path_n = fix_utils.bip32_path_string_to_n(path) # show message for Trezor T device while waiting for the user to choose the passphrase input method pub = WndUtils.run_thread_dialog(call_get_public_node, (get_public_node_fun, path_n), title=DEFAULT_HW_BUSY_TITLE, text=DEFAULT_HW_BUSY_MESSAGE, force_close_dlg_callback=partial( cancel_hw_thread_dialog, hw_client), show_window_delay_ms=1000) if pub: hw_session.set_base_info(path, pub) else: raise Exception('Couldn\'t read data from the hardware wallet.')
def get_session_info_trezor(get_public_node_fun, hw_session: HwSessionInfo): nonlocal hw_type def call_get_public_node(ctrl, get_public_node_fun, path_n): pk = get_public_node_fun(path_n).node.public_key return pk path = dash_utils.get_default_bip32_base_path(hw_session.app_config.dash_network) path_n = dash_utils.bip32_path_string_to_n(path) # show message for Trezor T device while waiting for the user to choose the passphrase input method pub = WndUtils.run_thread_dialog(call_get_public_node, (get_public_node_fun, path_n), title='Confirm', text='<b>Complete the action on your hardware wallet device</b>', show_window_delay_ms=1000) hw_session.set_base_info(path, pub)
def get_session_info_trezor(cli, hw_session: HwSessionInfo): path = dash_utils.get_default_bip32_base_path( hw_session.app_config.dash_network) path_n = dash_utils.bip32_path_string_to_n(path) pub = cli.get_public_node(path_n).node.public_key hw_session.set_base_info(path, pub)