Skip to content

Commit

Permalink
Simplify tests and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Feb 3, 2023
1 parent 54f54ab commit a4ace5c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions src/signMessage.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,17 @@ 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;
case SummaryItemPubkey:
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;
Expand Down
18 changes: 0 additions & 18 deletions tests/python/apps/solana.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
13 changes: 0 additions & 13 deletions tests/python/test_solana.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a4ace5c

Please sign in to comment.