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

53 lines
1.9 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_
from .common import TrezorTest
2017-06-23 19:31:42 +00:00
@pytest.mark.ethereum
class TestMsgEthereumGetaddress(TrezorTest):
2016-08-16 15:22:30 +00:00
def test_ethereum_getaddress(self):
self.setup_mnemonic_nopin_nopassphrase()
2018-08-13 16:21:24 +00:00
assert (
ethereum.get_address(self.client, [H_(44), H_(60)])
== "0xE025dfbE2C53638E547C6487DED34Add7b8Aafc1"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(self.client, [H_(44), H_(60), 1])
== "0xeD46C856D0c79661cF7d40FFE0C0C5077c00E898"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(self.client, [H_(44), H_(60), 0, H_(1)])
== "0x6682Fa7F3eC58581b1e576268b5463B4b5c93839"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(self.client, [H_(44), H_(60), H_(9), 0])
== "0xFb3BE0F9717fF5fCF3C58EB49a9Ed67F1BD89D4E"
2018-08-13 16:21:24 +00:00
)
assert (
ethereum.get_address(self.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(self.client, [H_(44), H_(6060), 0, 9999999])
== "0x98b8e926bd224764De2A0E4f4CBe1521474050AF"
2019-01-11 12:19:42 +00:00
)