|
|
|
@ -59,6 +59,12 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
|
|
|
|
|
from trezorlib.tools import parse_path
|
|
|
|
|
|
|
|
|
|
from ...common import parametrize_using_common_fixtures
|
|
|
|
|
from ...input_flows import InputFlowShowAddressQRCode
|
|
|
|
|
|
|
|
|
|
pytestmark = [
|
|
|
|
|
pytest.mark.altcoin,
|
|
|
|
|
pytest.mark.stellar,
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parameters_to_proto(parameters):
|
|
|
|
@ -80,8 +86,6 @@ def parameters_to_proto(parameters):
|
|
|
|
|
return tx, operations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.altcoin
|
|
|
|
|
@pytest.mark.stellar
|
|
|
|
|
@parametrize_using_common_fixtures("stellar/sign_tx.json")
|
|
|
|
|
def test_sign_tx(client: Client, parameters, result):
|
|
|
|
|
tx, operations = parameters_to_proto(parameters)
|
|
|
|
@ -92,8 +96,6 @@ def test_sign_tx(client: Client, parameters, result):
|
|
|
|
|
assert b64encode(response.signature).decode() == result["signature"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.altcoin
|
|
|
|
|
@pytest.mark.stellar
|
|
|
|
|
@parametrize_using_common_fixtures("stellar/sign_tx.json")
|
|
|
|
|
@pytest.mark.skipif(not stellar.HAVE_STELLAR_SDK, reason="requires Stellar SDK")
|
|
|
|
|
def test_xdr(parameters, result):
|
|
|
|
@ -110,13 +112,21 @@ def test_xdr(parameters, result):
|
|
|
|
|
assert expected == actual
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.altcoin
|
|
|
|
|
@pytest.mark.stellar
|
|
|
|
|
@pytest.mark.parametrize("chunkify", (True, False))
|
|
|
|
|
@parametrize_using_common_fixtures("stellar/get_address.json")
|
|
|
|
|
def test_get_address(client: Client, chunkify: bool, parameters, result):
|
|
|
|
|
def test_get_address(client: Client, parameters, result):
|
|
|
|
|
address_n = parse_path(parameters["path"])
|
|
|
|
|
address = stellar.get_address(
|
|
|
|
|
client, address_n, show_display=True, chunkify=chunkify
|
|
|
|
|
)
|
|
|
|
|
address = stellar.get_address(client, address_n, show_display=True)
|
|
|
|
|
assert address == result["address"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip_t1("No input flow for T1")
|
|
|
|
|
@parametrize_using_common_fixtures("stellar/get_address.json")
|
|
|
|
|
def test_get_address_chunkify_details(client: Client, parameters, result):
|
|
|
|
|
with client:
|
|
|
|
|
IF = InputFlowShowAddressQRCode(client)
|
|
|
|
|
client.set_input_flow(IF.get())
|
|
|
|
|
address_n = parse_path(parameters["path"])
|
|
|
|
|
address = stellar.get_address(
|
|
|
|
|
client, address_n, show_display=True, chunkify=True
|
|
|
|
|
)
|
|
|
|
|
assert address == result["address"]
|
|
|
|
|