Skip to content

Commit aff4748

Browse files
WIP - TO BE REMOVED
1 parent d0e9ab6 commit aff4748

3 files changed

Lines changed: 21 additions & 30 deletions

File tree

src/features/address_book/handle_identity.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ bool handle_check_register_identity(identity_t *params) {
137137
memmove(g_ctx.register_identity.identity, params, sizeof(identity_t));
138138
return true;
139139
}
140+
bool handle_check_identity(identity_t *params) {
141+
return handle_check_register_identity(params);
142+
}
140143

141144
/**
142145
* @brief Callback to retrieve a tag-value pair for the Register Identity UI
@@ -364,12 +367,12 @@ nbgl_contentTagValue_t *get_edit_identifier_tagValue(uint8_t pairIndex) {
364367
break;
365368

366369
case 2:
367-
g_ctx.current_pair.item = "Old address";
370+
g_ctx.current_pair.item = "Old address name";
368371
g_ctx.current_pair.value = g_ctx.edit_identifier.old_identifier;
369372
break;
370373

371374
case 3:
372-
g_ctx.current_pair.item = "New address";
375+
g_ctx.current_pair.item = "New address name";
373376
g_ctx.current_pair.value = g_ctx.edit_identifier.new_identifier;
374377
break;
375378

src/features/address_book/handle_ledger_account.c

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343

4444
/* Private defines -----------------------------------------------------------*/
4545

46-
/** Number of hex chars shown on each side of the middle-truncated address */
47-
#define ADDR_SHORT_HEX_LEN 4
48-
/** "0x" + ADDR_SHORT_HEX_LEN + "..." + ADDR_SHORT_HEX_LEN + '\0' */
49-
#define ADDR_DISPLAY_SHORT_SIZE (2 + ADDR_SHORT_HEX_LEN + 3 + ADDR_SHORT_HEX_LEN + 1)
50-
5146
/* Private types -------------------------------------------------------------*/
5247

5348
/**
@@ -56,7 +51,6 @@
5651
typedef struct {
5752
char *address_display;
5853
char *network_display;
59-
char address_display_short[ADDR_DISPLAY_SHORT_SIZE]; ///< "0x1234...5678"
6054
const char *texts[1];
6155
const char *subTexts[1];
6256
nbgl_warningDetails_t details;
@@ -152,6 +146,9 @@ bool handle_check_register_ledger_account(ledger_account_t *params) {
152146
memmove(g_ctx.ledger_account, params, sizeof(ledger_account_t));
153147
return true;
154148
}
149+
bool handle_check_ledger_account(ledger_account_t *account) {
150+
return handle_check_register_ledger_account(account);
151+
}
155152

156153
/**
157154
* @brief Handle called to display the Ledger Account review UI
@@ -161,7 +158,6 @@ void display_register_ledger_account_review(nbgl_choiceCallback_t choice_callbac
161158
get_network_icon_from_chain_id(&g_ctx.ledger_account->chain_id);
162159
register_ledger_account_ctx_t *ra = &g_ctx.register_account;
163160

164-
// Full address kept for the details modal (accessible via detail header icon)
165161
ra->texts[0] = "Address";
166162
ra->subTexts[0] = ra->address_display;
167163
ra->details.title = g_ctx.ledger_account->account_name;
@@ -170,27 +166,13 @@ void display_register_ledger_account_review(nbgl_choiceCallback_t choice_callbac
170166
ra->details.barList.texts = ra->texts;
171167
ra->details.barList.subTexts = ra->subTexts;
172168

173-
// Middle-truncated address for the subMessage line: "0x1234...5678"
174-
snprintf(ra->address_display_short,
175-
sizeof(ra->address_display_short),
176-
"0x%.*s...%s",
177-
ADDR_SHORT_HEX_LEN,
178-
ra->address_display + 2,
179-
ra->address_display + 2 + ADDRESS_LENGTH_HEX - ADDR_SHORT_HEX_LEN);
180-
181-
nbgl_useCaseAdvancedChoiceWithDetails(icon,
182-
#ifdef SCREEN_SIZE_WALLET
183-
&INFO_I_ICON,
184-
#else
185-
NULL,
186-
#endif
187-
"Confirm name?",
188-
g_ctx.ledger_account->account_name,
189-
ra->address_display_short,
190-
"Confirm",
191-
"Cancel",
192-
&ra->details,
193-
choice_callback);
169+
nbgl_useCaseChoiceWithDetails(icon,
170+
"Confirm name?",
171+
g_ctx.ledger_account->account_name,
172+
"Confirm",
173+
"Cancel",
174+
&ra->details,
175+
choice_callback);
194176
}
195177

196178
/* =========================================================================
@@ -363,5 +345,8 @@ bool handle_provide_ledger_account(const ledger_account_t *account) {
363345
PRINTF("Stored '%s' (chain %llu)\n", node->contact_name, node->chain_id);
364346
return true;
365347
}
348+
bool handle_provide_ledger_account_contact(const ledger_account_t *account) {
349+
return handle_provide_ledger_account(account);
350+
}
366351

367352
#endif // HAVE_ADDRESS_BOOK && HAVE_ADDRESS_BOOK_LEDGER_ACCOUNT

src/features/address_book/handle_provide_contact.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,5 +214,8 @@ bool handle_provide_identity(const identity_t *contact) {
214214
PRINTF("Stored '%s' (chain %llu)\n", node->contact_name, node->chain_id);
215215
return true;
216216
}
217+
bool handle_provide_contact(const identity_t *contact) {
218+
return handle_provide_identity(contact);
219+
}
217220

218221
#endif // HAVE_ADDRESS_BOOK

0 commit comments

Comments
 (0)