From a4ace5cece1a17da96bdb91ff46f28f6003299c2 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Fri, 3 Feb 2023 11:44:18 +0100 Subject: [PATCH] Simplify tests and linting --- .github/workflows/ci-workflow.yml | 2 +- src/signMessage.c | 6 ++++-- tests/python/apps/solana.py | 18 ------------------ tests/python/test_solana.py | 13 ------------- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 686ee4bb..1d5def00 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -60,7 +60,7 @@ jobs: path: scan-build python_tests_nano: - name: NanoS Ragger tests + name: Ragger tests needs: build_application runs-on: ubuntu-latest steps: diff --git a/src/signMessage.c b/src/signMessage.c index 4d3a3811..4357cfb2 100644 --- a/src/signMessage.c +++ b/src/signMessage.c @@ -182,7 +182,8 @@ static bool check_swap_validity(const SummaryItemKind_t kinds[MAX_TRANSACTION_SU if (strcmp(G_transaction_summary_title, "Transfer") == 0) { amount_ok = check_swap_amount(G_transaction_summary_text); } else { - PRINTF("Refused field '%s', expecting 'Transfer'\n", G_transaction_summary_title); + PRINTF("Refused field '%s', expecting 'Transfer'\n", + G_transaction_summary_title); return false; } break; @@ -190,7 +191,8 @@ static bool check_swap_validity(const SummaryItemKind_t kinds[MAX_TRANSACTION_SU if (strcmp(G_transaction_summary_title, "Recipient") == 0) { recipient_ok = check_swap_recipient(G_transaction_summary_text); } else { - PRINTF("Refused field '%s', expecting 'Recipient'\n", G_transaction_summary_title); + PRINTF("Refused field '%s', expecting 'Recipient'\n", + G_transaction_summary_title); return false; } break; diff --git a/tests/python/apps/solana.py b/tests/python/apps/solana.py index d5b22431..ccf41bb4 100644 --- a/tests/python/apps/solana.py +++ b/tests/python/apps/solana.py @@ -125,21 +125,3 @@ def send_async_sign_message(self, def get_async_response(self) -> RAPDU: return self._client.last_async_response - - - def send_blind_sign_message(self, derivation_path : bytes, message: bytes) -> RAPDU: - message_splited_prefixed = self.split_and_prefix_message(derivation_path, message) - - # Send all chunks with P2_MORE except for the last chunk - # Send all chunks with P2_EXTEND except for the first chunk - if len(message_splited_prefixed) > 1: - final_p2 |= P2_EXTEND - self.send_first_message_batch(message_splited_prefixed[:-1], P1_CONFIRM) - else: - final_p2 = 0 - - return self._client.exchange(CLA, - INS.INS_SIGN_MESSAGE, - P1_CONFIRM, - final_p2, - message_splited_prefixed[-1]) diff --git a/tests/python/test_solana.py b/tests/python/test_solana.py index e647e8eb..501f8684 100644 --- a/tests/python/test_solana.py +++ b/tests/python/test_solana.py @@ -65,16 +65,3 @@ def test_solana_simple_transfer_refused(backend, navigator, test_name): rapdu: RAPDU = sol.get_async_response() assert rapdu.status == ErrorType.USER_CANCEL - - -def test_solana_blind_sign_refused(backend): - sol = SolanaClient(backend) - from_public_key = sol.get_public_key(SOL_PACKED_DERIVATION_PATH) - - instruction: SystemInstructionTransfer = SystemInstructionTransfer(from_public_key, FOREIGN_PUBLIC_KEY, AMOUNT) - message: bytes = Message([instruction]).serialize() - - backend.raise_policy = RaisePolicy.RAISE_NOTHING - rapdu: RAPDU = sol.send_blind_sign_message(SOL_PACKED_DERIVATION_PATH, message) - assert rapdu.status == ErrorType.SDK_NOT_SUPPORTED -