1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-29 09:38:08 +00:00
trezor-firmware/tests/device_tests/test_msg_ethereum_getaddress.py

42 lines
1.6 KiB
Python
Raw Normal View History

# This file is part of the Trezor project.
2017-01-03 18:40:05 +00:00
#
2019-05-29 16:44:09 +00:00
# Copyright (C) 2012-2019 SatoshiLabs and contributors
2017-01-03 18:40:05 +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.
2017-01-03 18:40:05 +00:00
#
# 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>.
2018-08-13 16:21:24 +00:00
import pytest
2016-08-16 15:22:30 +00:00
2018-08-10 12:04:58 +00:00
from trezorlib import ethereum
from trezorlib.tools import parse_path
2018-08-13 16:21:24 +00:00
VECTORS = ( # path, address
("m/44'/60'/0'", "0xdA0b608bdb1a4A154325C854607c68950b4F1a34"),
("m/44'/60'/100'", "0x93Fb0Ff84F5BB6E7b6a9835C7AA6dE7a76794266"),
("m/44'/60'/0'/0/0", "0x73d0385F4d8E00C5e6504C6030F47BF6212736A8"),
("m/44'/60'/0'/0/100", "0x1e6E3708a059aEa1241a81c7aAe84b6CDbC54d59"),
# ETC
("m/44'/61'/0'/0/0", "0xF410e37E9C8BCf8CF319c84Ae9dCEbe057804a04"),
# GoChain
("m/44'/6060'/0'/0/0", "0xA26a450ef46a5f11a510eBA2119A3236fa0Aca92"),
# Wanchain
("m/44'/5718350'/0'/0/0", "0xe432a7533D689ceed00B7EE91d9368b8A1693bD2"),
)
2017-06-23 19:31:42 +00:00
@pytest.mark.altcoin
@pytest.mark.ethereum
@pytest.mark.parametrize("path, address", VECTORS)
def test_ethereum_getaddress(client, path, address):
address_n = parse_path(path)
assert ethereum.get_address(client, address_n) == address