Skip to content

Commit

Permalink
Merge pull request #224 from LedgerHQ/tdj/enable_tests_polkadot
Browse files Browse the repository at this point in the history
udpate the polkadot branch in CI for swap tests and fix extra data test for NanoS
  • Loading branch information
tdejoigny-ledger authored Nov 6, 2024
2 parents bec8cb0 + 37adcf9 commit 5734125
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
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

0 comments on commit 5734125

Please sign in to comment.