mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
device_tests: add failing tests for stellar
This commit is contained in:
parent
7cf46c6833
commit
015d72102d
@ -18,6 +18,8 @@ from .common import TrezorTest
|
||||
from .conftest import TREZOR_VERSION
|
||||
from binascii import hexlify
|
||||
from trezorlib import stellar
|
||||
from trezorlib import messages as proto
|
||||
from trezorlib.client import CallException
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
|
||||
@ -40,3 +42,12 @@ class TestMsgStellarGetAddress(TrezorTest):
|
||||
address = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH))
|
||||
|
||||
assert stellar.address_from_public_key(pubkey).decode('utf8') == address
|
||||
|
||||
def test_stellar_get_address_fail(self):
|
||||
self.setup_mnemonic_nopin_nopassphrase()
|
||||
|
||||
with pytest.raises(CallException) as exc:
|
||||
self.client.stellar_get_address(parse_path('m/0/1'))
|
||||
|
||||
assert exc.value.args[0] == proto.FailureType.ProcessError
|
||||
assert exc.value.args[1].endswith('Failed to derive private key')
|
||||
|
@ -18,6 +18,8 @@ from .common import TrezorTest
|
||||
from .conftest import TREZOR_VERSION
|
||||
from binascii import hexlify
|
||||
from trezorlib import stellar
|
||||
from trezorlib import messages as proto
|
||||
from trezorlib.client import CallException
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
|
||||
@ -32,3 +34,12 @@ class TestMsgStellarGetPublicKey(TrezorTest):
|
||||
response = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH))
|
||||
assert hexlify(response) == b'15d648bfe4d36f196cfb5735ffd8ca54cd4b8233f743f22449de7cf301cdb469'
|
||||
assert stellar.address_from_public_key(response) == b'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW'
|
||||
|
||||
def test_stellar_get_public_key_fail(self):
|
||||
self.setup_mnemonic_nopin_nopassphrase()
|
||||
|
||||
with pytest.raises(CallException) as exc:
|
||||
self.client.stellar_get_public_key(parse_path('m/0/1'))
|
||||
|
||||
assert exc.value.args[0] == proto.FailureType.ProcessError
|
||||
assert exc.value.args[1].endswith('Failed to derive private key')
|
||||
|
Loading…
Reference in New Issue
Block a user