-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new APDU PROMPT_UI_DISPLAY to prompt the UI after the addresses…
… checks Add companion APDUs CHECK_ASSET_IN_NO_DISPLAY and CHECK_REFUND_ADDRESS_NO_DISPLAY Clarify CHECK_ASSET_IN as the replacement of deprecated CHECK_ASSET_IN_LEGACY for LEGACY flows too Move FUND_LEGACY and SELL_LEGACY tests to use CHECK_ASSET_IN instead of CHECK_ASSET_IN_LEGACY Add dedicated tests for CHECK_ASSET_IN_LEGACY Move lib tests to use PROMPT_UI_DISPLAY Add dedicated tests for CHECK_ASSET_X_AND_DISPLAY
- Loading branch information
1 parent
0cf19c5
commit defae2c
Showing
102 changed files
with
334 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "globals.h" | ||
#include "commands.h" | ||
#include "states.h" | ||
#include "prompt_ui_display.h" | ||
#include "validate_transaction.h" | ||
|
||
void start_ui_display(void) { | ||
G_swap_ctx.state = WAITING_USER_VALIDATION; | ||
ui_validate_amounts(); | ||
} | ||
|
||
int prompt_ui_display(const command_t *cmd) { | ||
// We don't care about the command passed as argument | ||
UNUSED(cmd); | ||
start_ui_display(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include "commands.h" | ||
|
||
void start_ui_display(void); | ||
int prompt_ui_display(const command_t *cmd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#pragma once | ||
|
||
typedef enum { | ||
INITIAL_STATE = 0, | ||
WAITING_TRANSACTION = 1, | ||
PROVIDER_SET = 2, | ||
PROVIDER_CHECKED = 3, | ||
TRANSACTION_RECEIVED = 4, | ||
SIGNATURE_CHECKED = 5, | ||
TO_ADDR_CHECKED = 6, | ||
WAITING_USER_VALIDATION = 7, | ||
WAITING_SIGNING = 8, | ||
SIGN_FINISHED = 9, | ||
INITIAL_STATE, | ||
WAITING_TRANSACTION, | ||
PROVIDER_SET, | ||
PROVIDER_CHECKED, | ||
TRANSACTION_RECEIVED, | ||
SIGNATURE_CHECKED, | ||
PAYOUT_ADDRESS_CHECKED, | ||
ALL_ADDRESSES_CHECKED, | ||
WAITING_USER_VALIDATION, | ||
WAITING_SIGNING, | ||
SIGN_FINISHED, | ||
STATE_UPPER_BOUND, | ||
} state_e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+374 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+319 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+368 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+428 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+323 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+340 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+295 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+367 Bytes
test/python/snapshots/nanos/test_check_address_and_display_fund/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+374 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+360 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+368 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+293 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+323 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+340 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+295 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+367 Bytes
test/python/snapshots/nanos/test_check_address_and_display_sell/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+374 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+352 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+323 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+340 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+295 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+367 Bytes
test/python/snapshots/nanos/test_check_address_and_display_swap/00007.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00000.png
Oops, something went wrong.
Binary file added
BIN
+356 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00002.png
Oops, something went wrong.
Binary file added
BIN
+500 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_fund/00006.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00000.png
Oops, something went wrong.
Binary file added
BIN
+409 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00002.png
Oops, something went wrong.
Binary file added
BIN
+334 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_sell/00006.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00000.png
Oops, something went wrong.
Binary file added
BIN
+396 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00001.png
Oops, something went wrong.
Binary file added
BIN
+324 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00002.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00003.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00004.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanosp/test_check_address_and_display_swap/00005.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00000.png
Oops, something went wrong.
Binary file added
BIN
+356 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00002.png
Oops, something went wrong.
Binary file added
BIN
+500 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanox/test_check_address_and_display_fund/00006.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00000.png
Oops, something went wrong.
Binary file added
BIN
+409 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00002.png
Oops, something went wrong.
Binary file added
BIN
+334 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanox/test_check_address_and_display_sell/00006.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00000.png
Oops, something went wrong.
Binary file added
BIN
+396 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00001.png
Oops, something went wrong.
Binary file added
BIN
+324 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00002.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00003.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00004.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanox/test_check_address_and_display_swap/00005.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00000.png
Oops, something went wrong.
Binary file added
BIN
+356 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00002.png
Oops, something went wrong.
Binary file added
BIN
+500 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_fund/00006.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00000.png
Oops, something went wrong.
Binary file added
BIN
+409 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00001.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00002.png
Oops, something went wrong.
Binary file added
BIN
+334 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00003.png
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00005.png
Oops, something went wrong.
Binary file added
BIN
+391 Bytes
test/python/snapshots/nanox/test_check_asset_in_legacy_ok_sell/00006.png
Oops, something went wrong.
Binary file added
BIN
+11.2 KB
test/python/snapshots/stax/test_check_address_and_display_fund/review/00000.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
test/python/snapshots/stax/test_check_address_and_display_fund/review/00001.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
test/python/snapshots/stax/test_check_address_and_display_fund/review/00002.png
Oops, something went wrong.
Binary file added
BIN
+10.9 KB
test/python/snapshots/stax/test_check_address_and_display_sell/review/00000.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
test/python/snapshots/stax/test_check_address_and_display_sell/review/00001.png
Oops, something went wrong.
Binary file added
BIN
+11.7 KB
test/python/snapshots/stax/test_check_address_and_display_sell/review/00002.png
Oops, something went wrong.
Binary file added
BIN
+11.1 KB
test/python/snapshots/stax/test_check_address_and_display_swap/review/00000.png
Oops, something went wrong.
Binary file added
BIN
+11.2 KB
test/python/snapshots/stax/test_check_address_and_display_swap/review/00001.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
test/python/snapshots/stax/test_check_address_and_display_swap/review/00002.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import pytest | ||
from ragger.utils import prefix_with_len | ||
|
||
from .apps.exchange import ExchangeClient, Rate, SubCommand | ||
from .apps.litecoin import LitecoinClient | ||
|
||
from .apps.signing_authority import SigningAuthority, LEDGER_SIGNER | ||
from .apps.exchange_transaction_builder import get_partner_curve, craft_and_sign_tx, ALL_SUBCOMMANDS, get_credentials | ||
from .apps import cal as cal | ||
|
||
CURRENCY_FROM = cal.ETH_CURRENCY_CONFIGURATION | ||
CURRENCY_TO = cal.BTC_CURRENCY_CONFIGURATION | ||
|
||
SWAP_TX_INFOS = { | ||
"payin_address": b"0xd692Cb1346262F584D17B4B470954501f6715a82", | ||
"payin_extra_id": b"", | ||
"refund_address": b"0xDad77910DbDFdE764fC21FCD4E74D71bBACA6D8D", | ||
"refund_extra_id": b"", | ||
"payout_address": b"bc1qqtl9jlrwcr3fsfcjj2du7pu6fcgaxl5dsw2vyg", | ||
"payout_extra_id": b"", | ||
"currency_from": CURRENCY_FROM.ticker, | ||
"currency_to": CURRENCY_TO.ticker, | ||
"amount_to_provider": bytes.fromhex("013fc3a717fb5000"), | ||
"amount_to_wallet": b"\x0b\xeb\xc2\x00", | ||
} | ||
FUND_TX_INFOS = { | ||
"user_id": "John Wick", | ||
"account_name": "Remember Daisy", | ||
"in_currency": CURRENCY_FROM.ticker, | ||
"in_amount": b"\032\200\250]$T\000", | ||
"in_address": "0x252fb4acbe0de4f0bd2409a5ed59a71e4ef1d2bc" | ||
} | ||
SELL_TX_INFOS = { | ||
"trader_email": "[email protected]", | ||
"out_currency": "USD", | ||
"out_amount": {"coefficient": b"\x01", "exponent": 3}, | ||
"in_currency": CURRENCY_FROM.ticker, | ||
"in_amount": b"\032\200\250]$T\000", | ||
"in_address": "0x252fb4acbe0de4f0bd2409a5ed59a71e4ef1d2bc" | ||
} | ||
TX_INFOS = { | ||
SubCommand.SWAP: SWAP_TX_INFOS, | ||
SubCommand.SWAP_NG: SWAP_TX_INFOS, | ||
SubCommand.FUND: FUND_TX_INFOS, | ||
SubCommand.FUND_NG: FUND_TX_INFOS, | ||
SubCommand.SELL: SELL_TX_INFOS, | ||
SubCommand.SELL_NG: SELL_TX_INFOS, | ||
} | ||
|
||
class TestCheckAddressAndDisplay: | ||
|
||
@pytest.mark.parametrize("subcommand", ALL_SUBCOMMANDS) | ||
def test_check_address_and_display(self, backend, exchange_navigation_helper, subcommand): | ||
suffix = "_" + str(subcommand).split('.')[1].split('_')[0].lower() | ||
exchange_navigation_helper.set_test_name_suffix(suffix) | ||
|
||
ex = ExchangeClient(backend, Rate.FIXED, subcommand) | ||
partner = SigningAuthority(curve=get_partner_curve(subcommand), name="Default name") | ||
|
||
transaction_id = ex.init_transaction().data | ||
credentials = get_credentials(subcommand, partner) | ||
ex.set_partner_key(credentials) | ||
ex.check_partner_key(LEDGER_SIGNER.sign(credentials)) | ||
|
||
tx, tx_signature = craft_and_sign_tx(subcommand, TX_INFOS[subcommand], transaction_id, 339, partner) | ||
ex.process_transaction(tx) | ||
ex.check_transaction_signature(tx_signature) | ||
|
||
if subcommand == SubCommand.SWAP or subcommand == SubCommand.SWAP_NG: | ||
ex.check_payout_address(CURRENCY_TO.get_conf_for_ticker()) | ||
with ex.check_refund_address(CURRENCY_FROM.get_conf_for_ticker()): | ||
exchange_navigation_helper.simple_accept() | ||
else: | ||
with ex.check_asset_in(CURRENCY_FROM.get_conf_for_ticker()): | ||
exchange_navigation_helper.simple_accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# import pytest | ||
|
||
# from ragger.utils import RAPDU, prefix_with_len, create_currency_config | ||
# from ragger.error import ExceptionRAPDU | ||
|
||
# from .apps.exchange import ExchangeClient, Rate, SubCommand, Errors, Command, P2_EXTEND, P2_MORE, EXCHANGE_CLASS | ||
# from .apps.exchange_transaction_builder import get_partner_curve, LEGACY_SUBCOMMANDS, ALL_SUBCOMMANDS, NEW_SUBCOMMANDS, get_credentials, craft_and_sign_tx | ||
# from .apps.signing_authority import SigningAuthority, LEDGER_SIGNER | ||
# from .apps import cal as cal | ||
|
||
# from time import sleep | ||
|
||
# def test_custom(backend): | ||
# backend.exchange_raw(bytes.fromhex("e003010000")) | ||
# backend.exchange_raw(bytes.fromhex("e00401004b094368616e67656c6c790480d7c0d3a9183597395f58dda05999328da6f18fabd5cda0aff8e8e3fc633436a2dbf48ecb23d40df7c3c7d3e774b77b4b5df0e9f7e08cf1cdf2dba788eb085b")) | ||
# backend.exchange_raw(bytes.fromhex("e0050100473045022100e73339e5071b5d232e8cacecbd7c118c919122a43f8abb8b2062d4bfcd58274e022050b11605d8b7e199f791266146227c43fd11d7645b1d881f705a2f8841d21de5")) | ||
# backend.exchange_raw(bytes.fromhex("e0060100b4af0a225441347170665658613773584278613673667164347a4c6b4b5741625069333478671a22545046507459724e756636653971573237374e79373447576b77683259376b6d334a2a2a3078386331353633373964636665373631316333346231344238306341373437323837634636413337343a035452584204555344544a1000000000000000000000000024eee965521000000000000000000000000003b9b9eb5a0a46414d59545947595851030f4240")) | ||
# backend.exchange_raw(bytes.fromhex("e00701004630440220039c3f8f1bfe9f87a7642d28d26a2a8c46f34e77fc9982dfd6fbf3bdb1577d1c0220021a77b987c63be9562747616fb2cfbf960a58dcdd02092afb6f9cb3a17ecbc7")) | ||
# backend.exchange_raw(bytes.fromhex("e00801007315045553445408457468657265756d060455534454063045022100c2eb8f0cfd072affe2aa658eff831c19040542d7d960848ecdedc4f1d4a6f4ef02205ef9b141789f280482de903f8f9aacbea7f1f43db8e5404e7a197fbfeb736c9715058000002c8000003c800000000000000000000000")) | ||
# backend.exchange_raw(bytes.fromhex("e00901006d0f035452580454726f6e0503545258003045022100cc308621933e8e94ef6f0a1c05cd6e766a4c4131e0b320cdd8c0f02d7bdb919002206b18b6e92c0c7772be31c61bfbb6879f5e2f2f4e335294184a71e0e1e319c7cb15058000002c800000c3800000000000000000000000")) | ||
# backend.exchange_raw(bytes.fromhex("e00a010000")) | ||
# backend.exchange_raw(bytes.fromhex("e002000015058000002c800000c3800000000000000000000000")) | ||
# backend.exchange_raw(bytes.fromhex("e00410009c058000002c800000c38000000000000000000000000a02e40c220865e37291a9b34ee140e8a8abd0f0315a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a154191a961158bba9a35d8f33e02bf3404147cfd3c101215410110d0f5dc152691ab483dd2c59ef072fb46dad018e5d2bba70270e28f83d0f031")) |
Oops, something went wrong.