1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-04 21:48:17 +00:00
trezor-firmware/tests/device_tests/test_msg_ethereum_getaddress.py

59 lines
2.0 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
2018-08-13 16:21:24 +00:00
from trezorlib.tools import H_
2019-09-11 12:43:32 +00:00
from ..common import MNEMONIC12
2017-06-23 19:31:42 +00:00
@pytest.mark.altcoin
@pytest.mark.ethereum
2019-09-11 12:29:39 +00:00
class TestMsgEthereumGetaddress:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_ethereum_getaddress(self, client):
2018-08-13 16:21:24 +00:00
assert (
ethereum.get_address(client, [H_(44), H_(60)])
== "0xE025dfbE2C53638E547C6487DED34Add7b8Aafc1"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(client, [H_(44), H_(60), 1])
== "0xeD46C856D0c79661cF7d40FFE0C0C5077c00E898"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(client, [H_(44), H_(60), 0, H_(1)])
== "0x6682Fa7F3eC58581b1e576268b5463B4b5c93839"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(client, [H_(44), H_(60), H_(9), 0])
== "0xFb3BE0F9717fF5fCF3C58EB49a9Ed67F1BD89D4E"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(client, [H_(44), H_(60), 0, 9999999])
== "0x6b909b50d88c9A8E02453A87b3662E3e7a5E0CF1"
2018-08-13 16:21:24 +00:00
)
2019-01-11 12:19:42 +00:00
assert (
ethereum.get_address(client, [H_(44), H_(6060), 0, 9999999])
== "0x98b8e926bd224764De2A0E4f4CBe1521474050AF"
2019-01-11 12:19:42 +00:00
)
# Wanchain SLIP44 id
assert (
ethereum.get_address(client, [H_(44), H_(5718350), H_(0)])
== "0x4d643B1b556E14A27143a38bcE61230FFf5AFca8"
)