Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Jul 5, 2023
1 parent b091df2 commit ca32a57
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 15 deletions.
6 changes: 3 additions & 3 deletions test/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
# You can configure optional parameters by overriding the value of ragger.configuration.OPTIONAL_CONFIGURATION
# Please refer to ragger/conftest/configuration.py for their descriptions and accepted values

configuration.OPTIONAL.APP_NAME = "Exchange"
# configuration.OPTIONAL.APP_NAME = "Exchange"

configuration.OPTIONAL.SIDELOADED_APPS = {
# "bitcoin": "Bitcoin",
"bitcoin": "Bitcoin",
# "bitcoin_legacy": "Bitcoin Legacy",
"ethereum": "Ethereum",
# "ethereum_classic": "Ethereum Classic",
# "tezos": "Tezos Wallet",
# "xrp": "XRP",
# "litecoin": "Litecoin",
# "stellar": "Stellar",
"solana": "Solana",
# "solana": "Solana",
# "bsc": "Binance Smart Chain",
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 14 additions & 7 deletions test/python/test_swap_btc_to_etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def test_swap_btc_to_etc(backend, firmware, navigator, test_name):
tx_infos = {
"payin_address": "bc1q4uj6h8qmdq5699azdagacptw66p202kn0fte56",
"refund_address": "bc1qer57ma0fzhqys2cmydhuj9cprf9eg0nw922a8j",
"payout_address": "0x97E22bAc30AAbC10fBEf472B3513812fc717B2fD",
"payout_address": "0xDad77910DbDFdE764fC21FCD4E74D71bBACA6D8D",
"payin_extra_id": "",
"refund_extra_id": "",
"payout_extra_id": "",
"currency_from": "BTC",
"currency_to": "ETC",
"currency_to": "ETH",
"amount_to_provider": b"\021=\\",
"amount_to_wallet": b"eA\372:cl@\000",
}
Expand All @@ -37,11 +37,18 @@ def test_swap_btc_to_etc(backend, firmware, navigator, test_name):
ex.check_transaction_signature(partner)

with ex.check_address(payout_signer=LEDGER_SIGNER, refund_signer=LEDGER_SIGNER):
navigator.navigate_until_text_and_compare(NavInsID.RIGHT_CLICK,
[NavInsID.BOTH_CLICK],
"Accept",
ROOT_SCREENSHOT_PATH,
test_name)
if backend.firmware.device.startswith("nano"):
navigator.navigate_until_text_and_compare(NavInsID.RIGHT_CLICK,
[NavInsID.BOTH_CLICK],
"Accept",
ROOT_SCREENSHOT_PATH,
test_name)
else:
navigator.navigate_until_text_and_compare(NavInsID.USE_CASE_REVIEW_TAP,
[NavInsID.USE_CASE_REVIEW_CONFIRM],
"Hold to sign",
ROOT_SCREENSHOT_PATH,
test_name)
ex.start_signing_transaction()

# client._client is the Speculos backend within the Ragger client,
Expand Down
17 changes: 12 additions & 5 deletions test/python/test_swap_eth_to_btc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ def prepare_exchange(backend, firmware, navigator, test_name, amount: str):
ex.process_transaction(tx_infos, fees)
ex.check_transaction_signature(partner)
with ex.check_address(payout_signer=LEDGER_SIGNER, refund_signer=LEDGER_SIGNER):
navigator.navigate_until_text_and_compare(NavInsID.RIGHT_CLICK,
[NavInsID.BOTH_CLICK],
"Accept",
ROOT_SCREENSHOT_PATH,
test_name)
if backend.firmware.device.startswith("nano"):
navigator.navigate_until_text_and_compare(NavInsID.RIGHT_CLICK,
[NavInsID.BOTH_CLICK],
"Accept",
ROOT_SCREENSHOT_PATH,
test_name)
else:
navigator.navigate_until_text_and_compare(NavInsID.USE_CASE_REVIEW_TAP,
[NavInsID.USE_CASE_REVIEW_CONFIRM],
"Hold to sign",
ROOT_SCREENSHOT_PATH,
test_name)
ex.start_signing_transaction()


Expand Down

0 comments on commit ca32a57

Please sign in to comment.