You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.1 KiB
59 lines
2.1 KiB
6 years ago
|
# This file is part of the Trezor project.
|
||
7 years ago
|
#
|
||
5 years ago
|
# Copyright (C) 2012-2019 SatoshiLabs and contributors
|
||
7 years ago
|
#
|
||
|
# This library is free software: you can redistribute it and/or modify
|
||
6 years ago
|
# it under the terms of the GNU Lesser General Public License version 3
|
||
|
# as published by the Free Software Foundation.
|
||
7 years ago
|
#
|
||
|
# 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.
|
||
|
#
|
||
6 years ago
|
# 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>.
|
||
|
|
||
6 years ago
|
import pytest
|
||
7 years ago
|
|
||
6 years ago
|
from trezorlib import btc, debuglink
|
||
|
|
||
6 years ago
|
from .common import TrezorTest
|
||
7 years ago
|
|
||
|
|
||
7 years ago
|
@pytest.mark.skip_t2
|
||
7 years ago
|
class TestDeviceLoadXprv(TrezorTest):
|
||
7 years ago
|
def test_load_device_xprv_1(self):
|
||
6 years ago
|
debuglink.load_device_by_xprv(
|
||
|
self.client,
|
||
|
xprv="xprv9s21ZrQH143K2JF8RafpqtKiTbsbaxEeUaMnNHsm5o6wCW3z8ySyH4UxFVSfZ8n7ESu7fgir8imbZKLYVBxFPND1pniTZ81vKfd45EHKX73",
|
||
|
pin="",
|
||
|
passphrase_protection=False,
|
||
|
label="test",
|
||
|
language="english",
|
||
|
)
|
||
7 years ago
|
|
||
|
passphrase_protection = self.client.debug.read_passphrase_protection()
|
||
7 years ago
|
assert passphrase_protection is False
|
||
7 years ago
|
|
||
6 years ago
|
address = btc.get_address(self.client, "Bitcoin", [])
|
||
|
assert address == "128RdrAkJDmqasgvfRf6MC5VcX4HKqH4mR"
|
||
7 years ago
|
|
||
|
def test_load_device_xprv_2(self):
|
||
6 years ago
|
debuglink.load_device_by_xprv(
|
||
|
self.client,
|
||
|
xprv="xprv9s21ZrQH143K2JF8RafpqtKiTbsbaxEeUaMnNHsm5o6wCW3z8ySyH4UxFVSfZ8n7ESu7fgir8imbZKLYVBxFPND1pniTZ81vKfd45EHKX73",
|
||
|
pin="",
|
||
|
passphrase_protection=True,
|
||
|
label="test",
|
||
|
language="english",
|
||
|
)
|
||
7 years ago
|
|
||
6 years ago
|
self.client.set_passphrase("passphrase")
|
||
7 years ago
|
|
||
|
passphrase_protection = self.client.debug.read_passphrase_protection()
|
||
7 years ago
|
assert passphrase_protection is True
|
||
7 years ago
|
|
||
6 years ago
|
address = btc.get_address(self.client, "Bitcoin", [])
|
||
|
assert address == "1CHUbFa4wTTPYgkYaw2LHSd5D4qJjMU8ri"
|