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

udpate the polkadot branch in CI for swap tests and fix extra data test for NanoS #224

Merged
merged 2 commits into from
Nov 6, 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
8 changes: 4 additions & 4 deletions .github/workflows/reusable_swap_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ on:

branch_for_polkadot:
required: false
default: 'fbe/fix_new_swap_implem_rebased'
default: 'develop'
type: string
repo_for_polkadot:
required: false
Expand Down 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 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
10 changes: 7 additions & 3 deletions test/python/test_extra_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TestExtraData:
ConfForTest(payin_extra_id="abcdefghijklmnopqrs",
payin_extra_data=None,
valid=True),
# Having only one is allowed
# Having only one is allowed (except for NanoS)
ConfForTest(payin_extra_id=None,
payin_extra_data=bytes.fromhex("01000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"),
valid=True),
Expand All @@ -58,7 +58,7 @@ class TestExtraData:
payin_extra_data=bytes.fromhex("00"),
valid=True),
])
def test_extra_data_and_or_extra_id(self, backend, configurations):
def test_extra_data_and_or_extra_id(self, backend, configurations, firmware):
ex = ExchangeClient(backend, Rate.FIXED, SubCommand.SWAP_NG)
partner = SigningAuthority(curve=get_partner_curve(SubCommand.SWAP_NG), name="Default name")

Expand All @@ -84,7 +84,11 @@ def test_extra_data_and_or_extra_id(self, backend, configurations):

fees = 339

tx, tx_signature = craft_and_sign_tx(SubCommand.SWAP_NG, tx_infos, transaction_id, fees, partner)
tx, _ = craft_and_sign_tx(SubCommand.SWAP_NG, tx_infos, transaction_id, fees, partner)

# NanoS does not support payin_extra_data
if firmware.device == "nanos" and configurations.payin_extra_id is None and configurations.payin_extra_data == bytes.fromhex("01000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"):
configurations.valid = False

if configurations.valid:
ex.process_transaction(tx)
Expand Down
Loading