From 24c74a6ad0cd4625d63342307be9e65b85b4aea9 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 21 Feb 2024 12:47:19 +0100 Subject: [PATCH 1/2] fix: swap method len should match --- app/src/swap/handle_sign_transaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/swap/handle_sign_transaction.c b/app/src/swap/handle_sign_transaction.c index ad50f351..29bf4b8c 100644 --- a/app/src/swap/handle_sign_transaction.c +++ b/app/src/swap/handle_sign_transaction.c @@ -93,7 +93,8 @@ parser_error_t check_swap_conditions(const parser_context_t *ctx) { ctx->tx_obj->callIndex.moduleIdx, ctx->tx_obj->callIndex.idx)); - if (strncmp(tmp_str, &valid_tx_method[0], strlen(valid_tx_method)) != 0) { + if (strnlen(tmp_str, sizeof(tmp_str)) != strlen(valid_tx_method) || + strncmp(tmp_str, &valid_tx_method[0], strlen(valid_tx_method)) != 0) { ZEMU_LOGF(200, "Wrong swap tx method (%s, should be : %s).\n", tmp_str, valid_tx_method); return parser_swap_tx_wrong_method; } From e46b165251e8a1cae4eaae5415cf08348cd93bce Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Sun, 18 Feb 2024 20:03:56 +0100 Subject: [PATCH 2/2] Add reusable swap CI --- .github/workflows/swap.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/swap.yml diff --git a/.github/workflows/swap.yml b/.github/workflows/swap.yml new file mode 100644 index 00000000..1a8068b1 --- /dev/null +++ b/.github/workflows/swap.yml @@ -0,0 +1,18 @@ +name: Swap functional tests + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + job_functional_tests: + uses: LedgerHQ/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@develop + with: + branch_for_polkadot: ${{ github.ref }} + repo_for_polkadot: ${{ github.repository }} + test_filter: '"DOT or dot or Polkadot or polkadot"'