Skip to content

Commit

Permalink
Merge pull request #222 from LedgerHQ/disable-thorswap-on-nanos
Browse files Browse the repository at this point in the history
Make sure to return an error if a Thorchain swap is attempted on Nano S
  • Loading branch information
bigspider authored Oct 29, 2024
2 parents 0f7f826 + 539a0b6 commit bec8cb0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/reusable_swap_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ jobs:
- name: solana
repo: ${{ inputs.repo_for_solana }}
branch: ${{ inputs.branch_for_solana }}
- name: DOT
repo: ${{ inputs.repo_for_polkadot }}
branch: ${{ inputs.branch_for_polkadot }}
# - name: DOT
# repo: ${{ inputs.repo_for_polkadot }}
# branch: ${{ inputs.branch_for_polkadot }}
- name: tron
repo: ${{ inputs.repo_for_tron }}
branch: ${{ inputs.branch_for_tron }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ APPNAME = "Exchange"
# Application version
APPVERSION_M = 3
APPVERSION_N = 4
APPVERSION_P = 0
APPVERSION_P = 1
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

# Application source files
Expand Down
7 changes: 7 additions & 0 deletions src/process_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ static bool check_extra_id_extra_data(subcommand_e subcommand) {
}

if (has_extra_data) {
#ifdef TARGET_NANOS
// We make sure that we return an error on Nano S, if a payin_extra_data is provided.
// Nano S does not support Thorchain.
PRINTF("Error: payin_extra_data is not supported on Nano S.\n");
return false;
#endif

// Size has to be header + 32 bytes hash
if (extra->size != 33) {
PRINTF("Error: incorrect payin_extra_data size %d != 33; payin_extra_data = %.*H\n",
Expand Down
2 changes: 1 addition & 1 deletion test/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"litecoin": "Litecoin",
"stellar": "Stellar",
"solana": "Solana",
"DOT": "Polkadot",
# "DOT": "Polkadot",
"tron": "Tron",
"ton": "TON",
}
Expand Down
8 changes: 5 additions & 3 deletions test/python/test_polkadot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class TestsPolkadot:

@pytest.mark.parametrize('test_to_run', ALL_TESTS_EXCEPT_MEMO_THORSWAP_AND_FEES)
def test_polkadot(self, backend, exchange_navigation_helper, test_to_run):
if backend.firmware.device == "nanos":
pytest.skip("Polkadot swap is not supported on NanoS device")
PolkadotTests(backend, exchange_navigation_helper).run_test(test_to_run)
pytest.skip("Polkadot swap test is disabled")

# if backend.firmware.device == "nanos":
# pytest.skip("Polkadot swap is not supported on NanoS device")
# PolkadotTests(backend, exchange_navigation_helper).run_test(test_to_run)

0 comments on commit bec8cb0

Please sign in to comment.