diff --git a/Makefile b/Makefile index c72f1d0..fb8989d 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ APP_SOURCE_PATH += src ICON_NANOS = icons/nanos_app_phantasma.gif #16x16 ICON_NANOSP = icons/nanox_app_phantasma.gif #14x14 ICON_NANOX = icons/nanox_app_phantasma.gif #14x14 -ICON_STAX = icons/stax_app_phantasma.png #32x32 +ICON_STAX = icons/stax_app_phantasma.gif #32x32 # Application allowed derivation curves. # Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1 diff --git a/icons/stax_app_phantasma.gif b/icons/stax_app_phantasma.gif new file mode 100644 index 0000000..8c92990 Binary files /dev/null and b/icons/stax_app_phantasma.gif differ diff --git a/icons/stax_app_phantasma.png b/icons/stax_app_phantasma.png deleted file mode 100644 index afd255c..0000000 Binary files a/icons/stax_app_phantasma.png and /dev/null differ diff --git a/tests/application_client/boilerplate_command_sender.py b/tests/application_client/boilerplate_command_sender.py index 9486228..c5c4216 100644 --- a/tests/application_client/boilerplate_command_sender.py +++ b/tests/application_client/boilerplate_command_sender.py @@ -115,14 +115,13 @@ def sign_tx(self, path: str, transaction: bytes) -> Generator[None, None, None]: p2=P2.P2_MORE, data=msg) idx += 1 - + with self.backend.exchange_async(cla=CLA, ins=InsType.SIGN_TX, p1=idx, p2=P2.P2_LAST, data=messages[-1]) as response: yield response - print ("sign_tx: ", response) def get_async_response(self) -> Optional[RAPDU]: return self.backend.last_async_response diff --git a/tests/application_client/boilerplate_response_unpacker.py b/tests/application_client/boilerplate_response_unpacker.py index b20384b..bb0c0c4 100644 --- a/tests/application_client/boilerplate_response_unpacker.py +++ b/tests/application_client/boilerplate_response_unpacker.py @@ -55,11 +55,8 @@ def unpack_get_public_key_response(response: bytes) -> Tuple[int, bytes, int, by reponse_str = base64.b16encode(response) pub_key = reponse_str[0:64] pub_key_len = len(pub_key) - # - #print(TAG, reponse_str[0:64]) response, chain_code_len, chain_code = pop_size_prefixed_buf_from_buf(response) - print(TAG, chain_code_len, chain_code) assert pub_key_len == 64 diff --git a/tests/test_sign_cmd.py b/tests/test_sign_cmd.py index 2f4f61c..6d8ed36 100644 --- a/tests/test_sign_cmd.py +++ b/tests/test_sign_cmd.py @@ -1,7 +1,7 @@ import pytest from application_client.boilerplate_command_sender import BoilerplateCommandSender, Errors -from application_client.boilerplate_response_unpacker import unpack_get_public_key_response, unpack_sign_tx_response +from application_client.boilerplate_response_unpacker import unpack_sign_tx_response from ragger.error import ExceptionRAPDU from ragger.navigator import NavInsID from utils import ROOT_SCREENSHOT_PATH, check_signature_validity @@ -23,7 +23,7 @@ def test_sign_tx_short_tx(firmware, backend, navigator, test_name): path: str = "m/44'/60'/0'/0/0" # First we need to get the public key of the device in order to build the transaction - #rapdu = client.get_public_key(path=path) + rapdu = client.get_public_key(path=path) keys = PhantasmaKeys.from_wif("L5UEVHBjujaR1721aZM5Zm5ayjDyamMZS9W35RE9Y9giRkdf3dVx") amount = 10000000 @@ -43,30 +43,33 @@ def test_sign_tx_short_tx(firmware, backend, navigator, test_name): # you) "PHANTASMAROCKS" # PAYLOAD ) - txSerialized = Base16.decode_uint8_array(transaction.toString(False)) - print(TAG, Base16.encode_uint8_array(txSerialized)) + txSerialized = Base16.decode_uint8_array(transaction.toString(False)) - # Send the sign device instruction. - # As it requires on-screen validation, the function is asynchronous. - # It will yield the result when the navigation is done with client.sign_tx(path=path, transaction=txSerialized): - # Validate the on-screen request by performing the navigation appropriate for this device + print(firmware.device) if firmware.device.startswith("nano"): navigator.navigate_until_text_and_compare(NavInsID.RIGHT_CLICK, - [NavInsID.BOTH_CLICK], - "Approve", - ROOT_SCREENSHOT_PATH, - test_name) + [NavInsID.BOTH_CLICK], + "Approve", + ROOT_SCREENSHOT_PATH, + test_name) else: navigator.navigate_until_text_and_compare(NavInsID.USE_CASE_REVIEW_TAP, - [NavInsID.USE_CASE_REVIEW_CONFIRM, - NavInsID.USE_CASE_STATUS_DISMISS], - "Hold to sign", - ROOT_SCREENSHOT_PATH, - test_name) - # The device as yielded the result, parse it and ensure that the signature is correct - #response = client.get_async_response().data + [NavInsID.USE_CASE_REVIEW_CONFIRM, + NavInsID.USE_CASE_STATUS_DISMISS], + "Hold to sign", + ROOT_SCREENSHOT_PATH, + test_name) + print(client.get_async_response()) + response = client.get_async_response() + print(response) + # Send the sign device instruction. + # As it requires on-screen validation, the function is asynchronous. + # It will yield the result when the navigation is done + + + assert False #'''_, der_sig, _ = unpack_sign_tx_response(response) #assert check_signature_validity(public_key, der_sig, transaction)'''