2019-09-10 09:53:31 +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>.
|
|
|
|
|
2019-07-31 15:02:41 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from trezorlib import binance
|
2022-01-31 12:25:30 +00:00
|
|
|
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
2019-07-31 15:02:41 +00:00
|
|
|
from trezorlib.tools import parse_path
|
|
|
|
|
2023-07-26 14:45:10 +00:00
|
|
|
from ...input_flows import InputFlowShowXpubQRCode
|
|
|
|
|
2019-07-31 15:02:41 +00:00
|
|
|
BINANCE_PATH = parse_path("m/44h/714h/0h/0/0")
|
|
|
|
|
|
|
|
|
2019-08-22 16:47:01 +00:00
|
|
|
@pytest.mark.altcoin
|
2019-07-31 15:02:41 +00:00
|
|
|
@pytest.mark.binance
|
2024-03-11 15:20:08 +00:00
|
|
|
@pytest.mark.skip_t1b1 # T1 support is not planned
|
2019-08-26 16:26:57 +00:00
|
|
|
@pytest.mark.setup_client(
|
2019-07-31 15:02:41 +00:00
|
|
|
mnemonic="offer caution gift cross surge pretty orange during eye soldier popular holiday mention east eight office fashion ill parrot vault rent devote earth cousin"
|
|
|
|
)
|
2022-01-31 12:25:30 +00:00
|
|
|
def test_binance_get_public_key(client: Client):
|
2023-07-26 14:45:10 +00:00
|
|
|
with client:
|
|
|
|
IF = InputFlowShowXpubQRCode(client)
|
|
|
|
client.set_input_flow(IF.get())
|
|
|
|
sig = binance.get_public_key(client, BINANCE_PATH, show_display=True)
|
|
|
|
assert (
|
|
|
|
sig.hex()
|
|
|
|
== "029729a52e4e3c2b4a4e52aa74033eedaf8ba1df5ab6d1f518fd69e67bbd309b0e"
|
|
|
|
)
|