1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00
trezor-firmware/tests/device_tests/test_msg_ethereum_getpublickey.py

46 lines
1.6 KiB
Python
Raw Normal View History

2019-01-11 12:19:42 +00:00
# This file is part of the Trezor project.
#
2019-05-29 16:44:09 +00:00
# Copyright (C) 2012-2019 SatoshiLabs and contributors
2019-01-11 12:19:42 +00:00
#
# 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 import ethereum
from trezorlib.tools import H_
2019-09-11 12:43:32 +00:00
from ..common import MNEMONIC12
2019-01-11 12:19:42 +00:00
@pytest.mark.altcoin
2019-01-11 12:19:42 +00:00
@pytest.mark.ethereum
2019-09-11 12:29:39 +00:00
class TestMsgEthereumGetPublicKey:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_ethereum_getpublickey(self, client):
res = ethereum.get_public_node(client, [H_(44), H_(60), H_(0)])
assert res.node.depth == 3
assert res.node.fingerprint == 0xC10CFFDA
assert res.node.child_num == 0x80000000
2019-01-11 12:19:42 +00:00
assert (
res.node.chain_code.hex()
== "813d9feda6421f97a6472ff36679aa9e211ff88f6bdee51093af313ce628087e"
)
assert (
res.node.public_key.hex()
== "0318c22dedce01caca32354f98428e3af06a452f3fa84e6af8f1b6aa362affa641"
)
assert (
res.xpub
2019-01-11 12:19:42 +00:00
== "xpub6D54vV8eUYHMVBZCnz4SLjuiQngXURVCGKKGoJrWUDRegdMByLTJKfRs64q3UKiQCsSHJPtCQehTvERczdghS7gb8oedWSyNDtBU1zYDJtb"
)