2019-07-24 15:20:54 +00:00
|
|
|
# This file is part of the Trezor project.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2012-2019 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>.
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2019-08-02 16:13:56 +00:00
|
|
|
from trezorlib import btc
|
2019-07-24 15:20:54 +00:00
|
|
|
|
2019-09-19 07:37:23 +00:00
|
|
|
from ..common import MNEMONIC_SLIP39_BASIC_20_3of6
|
2019-07-24 15:20:54 +00:00
|
|
|
|
2019-09-02 08:20:51 +00:00
|
|
|
|
2019-09-19 07:37:23 +00:00
|
|
|
@pytest.mark.setup_client(mnemonic=MNEMONIC_SLIP39_BASIC_20_3of6, passphrase=True)
|
2019-07-24 15:20:54 +00:00
|
|
|
@pytest.mark.skip_t1
|
|
|
|
def test_3of6_passphrase(client):
|
|
|
|
"""
|
|
|
|
BIP32 Root Key for passphrase TREZOR:
|
|
|
|
provided by Andrew, address calculated using T1
|
|
|
|
xprv9s21ZrQH143K2pMWi8jrTawHaj16uKk4CSbvo4Zt61tcrmuUDMx2o1Byzcr3saXNGNvHP8zZgXVdJHsXVdzYFPavxvCyaGyGr1WkAYG83ce
|
|
|
|
"""
|
2019-08-02 16:13:56 +00:00
|
|
|
assert client.features.passphrase_protection is True
|
2020-02-12 14:38:18 +00:00
|
|
|
client.use_passphrase("TREZOR")
|
2019-07-24 15:20:54 +00:00
|
|
|
address = btc.get_address(client, "Bitcoin", [])
|
|
|
|
assert address == "18oZEMRWurCZW1FeK8sWYyXuWx2bFqEKyX"
|
|
|
|
|
|
|
|
|
2019-08-26 16:26:57 +00:00
|
|
|
@pytest.mark.setup_client(
|
2019-07-24 15:20:54 +00:00
|
|
|
mnemonic=(
|
|
|
|
"hobo romp academic axis august founder knife legal recover alien expect emphasis loan kitchen involve teacher capture rebuild trial numb spider forward ladle lying voter typical security quantity hawk legs idle leaves gasoline",
|
|
|
|
"hobo romp academic agency ancestor industry argue sister scene midst graduate profile numb paid headset airport daisy flame express scene usual welcome quick silent downtown oral critical step remove says rhythm venture aunt",
|
|
|
|
),
|
|
|
|
passphrase=True,
|
|
|
|
)
|
|
|
|
@pytest.mark.skip_t1
|
|
|
|
def test_2of5_passphrase(client):
|
|
|
|
"""
|
|
|
|
BIP32 Root Key for passphrase TREZOR:
|
|
|
|
provided by Andrew, address calculated using T1
|
|
|
|
xprv9s21ZrQH143K2o6EXEHpVy8TCYoMmkBnDCCESLdR2ieKwmcNG48ck2XJQY4waS7RUQcXqR9N7HnQbUVEDMWYyREdF1idQqxFHuCfK7fqFni
|
|
|
|
"""
|
2019-08-02 16:13:56 +00:00
|
|
|
assert client.features.passphrase_protection is True
|
2020-02-12 14:38:18 +00:00
|
|
|
client.use_passphrase("TREZOR")
|
2019-07-24 15:20:54 +00:00
|
|
|
address = btc.get_address(client, "Bitcoin", [])
|
|
|
|
assert address == "19Fjs9AvT13Y2Nx8GtoVfADmFWnccsPinQ"
|