Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Mar 30, 2023
1 parent bf6e813 commit 108be1e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/handle_sign_offchain_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "apdu.h"
#include "handle_sign_offchain_message.h"


// Store locally the derived public key content
static Pubkey G_publicKey;

Expand Down
1 change: 0 additions & 1 deletion src/ui/get_pubkey_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "sol/printer.h"
#include "nbgl_use_case.h"


static void callback_match(bool match) {
if (match) {
sendResponse(set_result_get_pubkey(), true, false);
Expand Down
18 changes: 14 additions & 4 deletions src/ui/menu_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ static void settings_controls_callback(int token, uint8_t index) {
case BLIND_SIGNING_TOKEN:
G_switches[BLIND_SIGNING_IDX].initState = !(G_switches[BLIND_SIGNING_IDX].initState);
new_setting = (G_switches[BLIND_SIGNING_IDX].initState == ON_STATE);
nvm_write((void*) &N_storage.settings.allow_blind_sign, &new_setting, sizeof(new_setting));
nvm_write((void*) &N_storage.settings.allow_blind_sign,
&new_setting,
sizeof(new_setting));
break;
case PUBLIC_KEY_LENGTH_TOKEN:
G_switches[PUBLIC_KEY_LENGTH_IDX].initState = !(G_switches[PUBLIC_KEY_LENGTH_IDX].initState);
G_switches[PUBLIC_KEY_LENGTH_IDX].initState =
!(G_switches[PUBLIC_KEY_LENGTH_IDX].initState);
new_setting = (G_switches[PUBLIC_KEY_LENGTH_IDX].initState == ON_STATE);
nvm_write((void*) &N_storage.settings.pubkey_display, &new_setting, sizeof(new_setting));
nvm_write((void*) &N_storage.settings.pubkey_display,
&new_setting,
sizeof(new_setting));
break;
case DISPLAY_MODE_TOKEN:
G_switches[DISPLAY_MODE_IDX].initState = !(G_switches[DISPLAY_MODE_IDX].initState);
Expand Down Expand Up @@ -128,7 +133,12 @@ static void ui_menu_settings(void) {
}

void ui_idle(void) {
nbgl_useCaseHome(APPNAME, &C_icon_solana_64x64, "This app confirms actions on\nthe " APPNAME " network.", true, ui_menu_settings, quit_app_callback);
nbgl_useCaseHome(APPNAME,
&C_icon_solana_64x64,
"This app confirms actions on\nthe " APPNAME " network.",
true,
ui_menu_settings,
quit_app_callback);
}

#endif
10 changes: 7 additions & 3 deletions src/ui/sign_message_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "handle_sign_message.h"
#include "handle_sign_offchain_message.h"


// Layout of the review flow
static nbgl_layoutTagValueList_t layout;
// Used by NBGL to display the reference the pair number N
Expand Down Expand Up @@ -67,7 +66,9 @@ static nbgl_layoutTagValue_t *get_single_action_review_pair(uint8_t index) {
// Final step is special for ASCII messages
if (index == transaction_steps_number - 1 && last_step_is_ascii) {
strlcpy(slot->title, "Message", sizeof(slot->title));
strlcpy(slot->text, (const char *) G_command.message + OFFCHAIN_MESSAGE_HEADER_LENGTH, sizeof(slot->text));
strlcpy(slot->text,
(const char *) G_command.message + OFFCHAIN_MESSAGE_HEADER_LENGTH,
sizeof(slot->text));
} else {
enum DisplayFlags flags = DisplayFlagNone;
if (N_storage.settings.pubkey_display == PubkeyDisplayLong) {
Expand All @@ -94,7 +95,10 @@ static void start_review(void) {
layout.startIndex = 0;
layout.nbPairs = transaction_steps_number;

nbgl_useCaseStaticReview(&layout, &review_final_long_press, "Reject message", review_final_callback);
nbgl_useCaseStaticReview(&layout,
&review_final_long_press,
"Reject message",
review_final_callback);
}

void start_sign_tx_ui(size_t num_summary_steps) {
Expand Down

0 comments on commit 108be1e

Please sign in to comment.