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/**
5651typedef 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
0 commit comments