Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ICON_NANOX = icons/nanox_app_tron.gif
ICON_NANOSP = icons/nanox_app_tron.gif
ICON_STAX = icons/stax_app_tron.gif
ICON_FLEX = icons/flex_app_tron.gif
ICON_APEX_P = icons/apex_app_tron.png

ENABLE_BLUETOOTH = 1
ENABLE_SWAP = 1
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.1
0.7.3
Binary file added glyphs/app_tron_48px.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 icons/apex_app_tron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanox", "nanos+", "stax", "flex"]
devices = ["nanox", "nanos+", "stax", "flex", "apex_p"]

[tests]
pytest_directory = "./tests/"
10 changes: 10 additions & 0 deletions src/ui/ui_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
#define VOTE_PACK (VOTE_ADDRESS_SIZE + VOTE_AMOUNT_SIZE)
#define voteSlot(index, type) ((index * VOTE_PACK) + type)

#ifdef HAVE_NBGL
#if LARGE_ICON_SIZE == 64
#define APP_TRON_ICON C_app_tron_64px
#elif LARGE_ICON_SIZE == 48
#define APP_TRON_ICON C_app_tron_48px
#else
#define APP_TRON_ICON C_app_tron_48px
#endif // LARGE_ICON_SIZE
#endif // HAVE_NBGL

extern volatile uint8_t customContractField;
extern char
fromAddress[BASE58CHECK_ADDRESS_SIZE + 1 + 5]; // 5 extra bytes used to inform MultSign ID
Expand Down
3 changes: 2 additions & 1 deletion src/ui/ui_idle_menu_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "glyphs.h"
#include "ux.h"
#include "nbgl_use_case.h"
#include "ui_globals.h"
#include "settings.h"

enum {
Expand Down Expand Up @@ -100,7 +101,7 @@ void ui_idle(void) {
switches[2].initState = (HAS_SETTING(S_SIGN_BY_HASH)) ? ON_STATE : OFF_STATE;

nbgl_useCaseHomeAndSettings(APPNAME,
&C_app_tron_64px,
&APP_TRON_ICON,
NULL,
INIT_HOME_PAGE,
&settingContents,
Expand Down
21 changes: 6 additions & 15 deletions src/ui/ui_review_menu_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static void displayCustomContractWarning(void);
static void dataWarningChoice(bool reject);
static void customContractWarningChoice(bool reject);
static void reviewChoice(bool confirm);
static void rejectConfirmation(void);
static void rejectChoice(void);

static void dataWarningChoice(bool accept) {
Expand All @@ -92,7 +91,7 @@ static void customContractWarningChoice(bool accept) {
}

static void displayDataWarning(void) {
nbgl_useCaseChoice(&C_Important_Circle_64px,
nbgl_useCaseChoice(&IMPORTANT_CIRCLE_ICON,
"WARNING\nThis transaction\ncontains\nextra data",
"Reject if you're not sure",
"Continue",
Expand All @@ -101,7 +100,7 @@ static void displayDataWarning(void) {
}

static void displayCustomContractWarning(void) {
nbgl_useCaseChoice(&C_Important_Circle_64px,
nbgl_useCaseChoice(&IMPORTANT_CIRCLE_ICON,
"WARNING\nCustom Contract\nProceed with care",
"Reject if you're not sure",
"Continue",
Expand All @@ -113,7 +112,7 @@ static void displayTransaction(void) {
// Start review
nbgl_useCaseReview(TYPE_TRANSACTION,
&pairList,
&C_app_tron_64px,
&APP_TRON_ICON,
txInfos.flowTitle,
txInfos.flowSubtitle,
infoLongPress.text,
Expand Down Expand Up @@ -154,7 +153,7 @@ static void reviewChoice(bool confirm) {
}
}

static void rejectConfirmation(void) {
static void rejectChoice(void) {
if (txInfos.state == APPROVAL_SIGN_TIP72_TRANSACTION) {
ui_callback_signMessage712_v0_cancel(false);
} else {
Expand All @@ -163,14 +162,6 @@ static void rejectConfirmation(void) {
nbgl_useCaseReviewStatus(STATUS_TYPE_TRANSACTION_REJECTED, ui_idle);
}

static void rejectChoice(void) {
nbgl_useCaseConfirm("Reject transaction?",
NULL,
"Yes, Reject",
"Go back to transaction",
rejectConfirmation);
}

static char *format_hash(const uint8_t *hash, char *buffer, size_t buffer_size, size_t offset) {
bytes_to_string(buffer + offset, buffer_size - offset, hash, 32);
return buffer + offset;
Expand All @@ -186,7 +177,7 @@ static void prepareTxInfos(ui_approval_state_t state, bool data_warning) {

infoLongPress.text = "Sign transaction";
infoLongPress.longPressText = "Hold to sign";
infoLongPress.icon = &C_app_tron_64px;
infoLongPress.icon = &APP_TRON_ICON;

pairList.pairs = (nbgl_layoutTagValue_t *) txInfos.fields;

Expand Down Expand Up @@ -439,7 +430,7 @@ void ux_flow_display(ui_approval_state_t state, bool data_warning) {
if (state == APPROVAL_VERIFY_ADDRESS) {
nbgl_useCaseAddressReview(toAddress,
NULL,
&C_app_tron_64px,
&APP_TRON_ICON,
"Verify Tron\naddress",
NULL,
display_address_callback);
Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ def configuration(backend: BackendInterface, navigator, firmware):
# Go back to main menu.
NavIns(NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT),
]
elif firmware.device.startswith("apex_p"):
instructions = [
# Go to settings menu.
NavIns(NavInsID.USE_CASE_HOME_SETTINGS),
# Allow data in TXs
NavIns(NavInsID.TOUCH, (150, 110)),
# Allow custom contracts
NavIns(NavInsID.TOUCH, (150, 220)),
NavIns(NavInsID.USE_CASE_SETTINGS_NEXT),
# Allow sign by hash
NavIns(NavInsID.TOUCH, (150, 110)),
# Go back to main menu.
NavIns(NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT),
]
else:
instructions = [
# Go to settings main menu
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ ledgerblue==0.1.45
ragger[speculos]>=1.7.1
ragger[ledgerwallet]>=1.7.1
ecdsa>=0.16.1,<0.17.0
pysha3>=1.0.0,<2.0.0
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.
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.
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.
Binary file added tests/snapshots/apex_p/test_trx_send/00000.png
Binary file added tests/snapshots/apex_p/test_trx_send/00001.png
Binary file added tests/snapshots/apex_p/test_trx_send/00002.png
Binary file added tests/snapshots/apex_p/test_trx_send/00003.png
Binary file added tests/snapshots/apex_p/test_trx_send/00004.png
Binary file added tests/snapshots/apex_p/test_trx_send/00005.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00000.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00001.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00002.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00003.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00004.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00005.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00006.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00007.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00008.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_account_update/00009.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00000.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00001.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00002.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00003.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00004.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00005.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00006.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00007.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_trx_ecdh_key/00008.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading
Loading