mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 20:38:10 +00:00
76c6e9cd9d
WIP - change trezor{1,2} to their internal names, add support for model R WIP - add EOS and NEM features Capability only for TT WIP - not include EOS and NEM into TR WIP - choose between device models when generating coininfo WIP - regenerate coininfo.py WIP - skip NEM, EOS, Dash, BGold and Decred device tests for TR WIP - fix python support WIP - fix unit tests WIP - import bitcoin-like code only when needed WIP - remove ignored coins for TR in fixtures.json WIP - make all the external references to models UPPERCASE WIP - do the model separation in mako script also for tokens and networks WIP - hot-fixing non-supporting RELEASES_URL for new model names WIP - support.py releases CLI command takes a list of -r key-value pairs DEVICE=VERSION WIP - run `python support.py release` WIP - use utils.MODEL_IS_T2B1 to ignore NEM and EOS WIP - change all the docs and commands to have UPPERCASE model names [no changelog]
65 lines
2.3 KiB
Python
65 lines
2.3 KiB
Python
# 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
|
|
|
|
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
|
from trezorlib.eos import get_public_key
|
|
from trezorlib.tools import parse_path
|
|
|
|
from ...common import MNEMONIC12
|
|
from ...input_flows import InputFlowShowXpubQRCode
|
|
|
|
|
|
@pytest.mark.altcoin
|
|
@pytest.mark.eos
|
|
@pytest.mark.skip_t1
|
|
@pytest.mark.skip_tr # coin not supported
|
|
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
|
|
def test_eos_get_public_key(client: Client):
|
|
with client:
|
|
IF = InputFlowShowXpubQRCode(client)
|
|
client.set_input_flow(IF.get())
|
|
public_key = get_public_key(
|
|
client, parse_path("m/44h/194h/0h/0/0"), show_display=True
|
|
)
|
|
assert (
|
|
public_key.wif_public_key
|
|
== "EOS4u6Sfnzj4Sh2pEQnkXyZQJqH3PkKjGByDCbsqqmyq6PttM9KyB"
|
|
)
|
|
assert (
|
|
public_key.raw_public_key.hex()
|
|
== "02015fabe197c955036bab25f4e7c16558f9f672f9f625314ab1ec8f64f7b1198e"
|
|
)
|
|
public_key = get_public_key(client, parse_path("m/44h/194h/0h/0/1"))
|
|
assert (
|
|
public_key.wif_public_key
|
|
== "EOS5d1VP15RKxT4dSakWu2TFuEgnmaGC2ckfSvQwND7pZC1tXkfLP"
|
|
)
|
|
assert (
|
|
public_key.raw_public_key.hex()
|
|
== "02608bc2c431521dee0b9d5f2fe34053e15fc3b20d2895e0abda857b9ed8e77a78"
|
|
)
|
|
public_key = get_public_key(client, parse_path("m/44h/194h/1h/0/0"))
|
|
assert (
|
|
public_key.wif_public_key
|
|
== "EOS7UuNeTf13nfcG85rDB7AHGugZi4C4wJ4ft12QRotqNfxdV2NvP"
|
|
)
|
|
assert (
|
|
public_key.raw_public_key.hex()
|
|
== "035588a197bd5a7356e8a702361b2d535c6372f843874bed6617cd1afe1dfcb502"
|
|
)
|