# Path: trezorlib/btc.py
# def get_public_node(
#     client,
#     n,
#     ecdsa_curve_name=None,
#     show_display=False,
#     coin_name=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def get_address(
#     client,
#     coin_name,
#     n,
#     show_display=False,
#     multisig=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def sign_message(
#     client, coin_name, n, message, script_type=messages.InputScriptType.SPENDADDRESS
# ):
# def verify_message(client, coin_name, address, signature, message):
# def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
#     def copy_tx_meta(tx):
#     R = messages.RequestType
# 
# Path: trezorlib/debuglink.py
# EXPECTED_RESPONSES_CONTEXT_LINES = 3
#     INPUT_FLOW_DONE = object()
# class DebugLink:
# class NullDebugLink(DebugLink):
# class DebugUI:
# class TrezorClientDebugLink(TrezorClient):
#     def __init__(self, transport, auto_interact=True):
#     def open(self):
#     def close(self):
#     def _call(self, msg, nowait=False):
#     def state(self):
#     def read_pin(self):
#     def read_pin_encoded(self):
#     def encode_pin(self, pin, matrix=None):
#     def read_layout(self):
#     def read_mnemonic_secret(self):
#     def read_recovery_word(self):
#     def read_reset_word(self):
#     def read_reset_word_pos(self):
#     def read_reset_entropy(self):
#     def read_passphrase_protection(self):
#     def input(self, word=None, button=None, swipe=None):
#     def press_button(self, yes_no):
#     def press_yes(self):
#     def press_no(self):
#     def swipe_up(self):
#     def swipe_down(self):
#     def stop(self):
#     def memory_read(self, address, length):
#     def memory_write(self, address, memory, flash=False):
#     def flash_erase(self, sector):
#     def __init__(self):
#     def open(self):
#     def close(self):
#     def _call(self, msg, nowait=False):
#     def __init__(self, debuglink: DebugLink):
#     def button_request(self, code):
#     def get_pin(self, code=None):
#     def get_passphrase(self):
#     def __init__(self, transport, auto_interact=True):
#     def open(self):
#     def close(self):
#     def set_filter(self, message_type, callback):
#     def _filter_message(self, msg):
#     def set_input_flow(self, input_flow):
#     def __enter__(self):
#     def __exit__(self, _type, value, traceback):
#     def set_expected_responses(self, expected):
#     def setup_debuglink(self, button, pin_correct):
#     def set_passphrase(self, passphrase):
#     def set_mnemonic(self, mnemonic):
#     def _raw_read(self):
#     def _raw_write(self, msg):
#     def _raise_unexpected_response(self, msg):
#     def _check_request(self, msg):
#     def mnemonic_callback(self, _):
# def load_device_by_mnemonic(
#     client,
#     mnemonic,
#     pin,
#     passphrase_protection,
#     label,
#     language="english",
#     skip_checksum=False,
#     expand=False,
# ):
# def load_device_by_xprv(client, xprv, pin, passphrase_protection, label, language):
# def self_test(client):
# 
# Path: trezorlib/device.py
# RECOVERY_BACK = "\x08"  # backspace character, sent literally
# class TrezorDevice:
#     def enumerate(cls):
#     def find_by_path(cls, path):
# def apply_settings(
#     client,
#     label=None,
#     language=None,
#     use_passphrase=None,
#     homescreen=None,
#     passphrase_source=None,
#     auto_lock_delay_ms=None,
#     display_rotation=None,
# ):
# def apply_flags(client, flags):
# def change_pin(client, remove=False):
# def set_u2f_counter(client, u2f_counter):
# def wipe(client):
# def recover(
#     client,
#     word_count=24,
#     passphrase_protection=False,
#     pin_protection=True,
#     label=None,
#     language="english",
#     input_callback=None,
#     type=proto.RecoveryDeviceType.ScrambledWords,
#     dry_run=False,
#     u2f_counter=None,
# ):
# def reset(
#     client,
#     display_random=False,
#     strength=None,
#     passphrase_protection=False,
#     pin_protection=True,
#     label=None,
#     language="english",
#     u2f_counter=0,
#     skip_backup=False,
#     no_backup=False,
# ):
# def backup(client):


import pytest
from trezorlib import btc, debuglink, device
from .common import TrezorTest
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.





@pytest.mark.skip_t2
class TestDeviceLoad(TrezorTest):
    def test_load_device_1(self):
        self.setup_mnemonic_nopin_nopassphrase(lock=False)
        state = self.client.debug.state()
        assert state.mnemonic_secret == self.mnemonic12.encode()
        assert state.pin is None
        assert state.passphrase_protection is False


# Path: trezorlib/btc.py
# def get_public_node(
#     client,
#     n,
#     ecdsa_curve_name=None,
#     show_display=False,
#     coin_name=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def get_address(
#     client,
#     coin_name,
#     n,
#     show_display=False,
#     multisig=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def sign_message(
#     client, coin_name, n, message, script_type=messages.InputScriptType.SPENDADDRESS
# ):
# def verify_message(client, coin_name, address, signature, message):
# def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
#     def copy_tx_meta(tx):
#     R = messages.RequestType
# 
# Path: trezorlib/debuglink.py
# EXPECTED_RESPONSES_CONTEXT_LINES = 3
#     INPUT_FLOW_DONE = object()
# class DebugLink:
# class NullDebugLink(DebugLink):
# class DebugUI:
# class TrezorClientDebugLink(TrezorClient):
#     def __init__(self, transport, auto_interact=True):
#     def open(self):
#     def close(self):
#     def _call(self, msg, nowait=False):
#     def state(self):
#     def read_pin(self):
#     def read_pin_encoded(self):
#     def encode_pin(self, pin, matrix=None):
#     def read_layout(self):
#     def read_mnemonic_secret(self):
#     def read_recovery_word(self):
#     def read_reset_word(self):
#     def read_reset_word_pos(self):
#     def read_reset_entropy(self):
#     def read_passphrase_protection(self):
#     def input(self, word=None, button=None, swipe=None):
#     def press_button(self, yes_no):
#     def press_yes(self):
#     def press_no(self):
#     def swipe_up(self):
#     def swipe_down(self):
#     def stop(self):
#     def memory_read(self, address, length):
#     def memory_write(self, address, memory, flash=False):
#     def flash_erase(self, sector):
#     def __init__(self):
#     def open(self):
#     def close(self):
#     def _call(self, msg, nowait=False):
#     def __init__(self, debuglink: DebugLink):
#     def button_request(self, code):
#     def get_pin(self, code=None):
#     def get_passphrase(self):
#     def __init__(self, transport, auto_interact=True):
#     def open(self):
#     def close(self):
#     def set_filter(self, message_type, callback):
#     def _filter_message(self, msg):
#     def set_input_flow(self, input_flow):
#     def __enter__(self):
#     def __exit__(self, _type, value, traceback):
#     def set_expected_responses(self, expected):
#     def setup_debuglink(self, button, pin_correct):
#     def set_passphrase(self, passphrase):
#     def set_mnemonic(self, mnemonic):
#     def _raw_read(self):
#     def _raw_write(self, msg):
#     def _raise_unexpected_response(self, msg):
#     def _check_request(self, msg):
#     def mnemonic_callback(self, _):
# def load_device_by_mnemonic(
#     client,
#     mnemonic,
#     pin,
#     passphrase_protection,
#     label,
#     language="english",
#     skip_checksum=False,
#     expand=False,
# ):
# def load_device_by_xprv(client, xprv, pin, passphrase_protection, label, language):
# def self_test(client):
# 
# Path: trezorlib/device.py
# RECOVERY_BACK = "\x08"  # backspace character, sent literally
# class TrezorDevice:
#     def enumerate(cls):
#     def find_by_path(cls, path):
# def apply_settings(
#     client,
#     label=None,
#     language=None,
#     use_passphrase=None,
#     homescreen=None,
#     passphrase_source=None,
#     auto_lock_delay_ms=None,
#     display_rotation=None,
# ):
# def apply_flags(client, flags):
# def change_pin(client, remove=False):
# def set_u2f_counter(client, u2f_counter):
# def wipe(client):
# def recover(
#     client,
#     word_count=24,
#     passphrase_protection=False,
#     pin_protection=True,
#     label=None,
#     language="english",
#     input_callback=None,
#     type=proto.RecoveryDeviceType.ScrambledWords,
#     dry_run=False,
#     u2f_counter=None,
# ):
# def reset(
#     client,
#     display_random=False,
#     strength=None,
#     passphrase_protection=False,
#     pin_protection=True,
#     label=None,
#     language="english",
#     u2f_counter=0,
#     skip_backup=False,
#     no_backup=False,
# ):
# def backup(client):


# Path: trezorlib/tests/device_tests/test_msg_loaddevice.py
import pytest
from trezorlib import btc, debuglink, device
from .common import TrezorTest

# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.





@pytest.mark.skip_t2
class TestDeviceLoad(TrezorTest):
    def test_load_device_1(self):
        self.setup_mnemonic_nopin_nopassphrase(lock=False)
        state = self.client.debug.state()
        assert state.mnemonic_secret == self.mnemonic12.encode()
        assert state.pin is None
        assert state.passphrase_protection is False


        address = btc.get_address(self.client, "Bitcoin", [])