Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to return an error if a Thorchain swap is attempted on Nano S #222

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading