@@ -316,15 +316,13 @@ static int strcasecmp_workaround(const char *str1, const char *str2) {
316
316
return 0 ;
317
317
}
318
318
319
- __attribute__((noinline )) static void finalize_parsing_helper (bool direct , bool * use_standard_UI ) {
319
+ __attribute__((noinline )) static bool finalize_parsing_helper (bool direct , bool * use_standard_UI ) {
320
320
char displayBuffer [50 ];
321
321
uint8_t decimals = WEI_TO_ETHER ;
322
322
uint64_t chain_id = get_tx_chain_id ();
323
323
const char * ticker = get_displayable_ticker (& chain_id , chainConfig );
324
324
ethPluginFinalize_t pluginFinalize ;
325
325
326
- * use_standard_UI = true;
327
-
328
326
// Verify the chain
329
327
if (chainConfig -> chainId != ETHEREUM_MAINNET_CHAINID ) {
330
328
uint64_t id = get_tx_chain_id ();
@@ -334,7 +332,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
334
332
reset_app_context ();
335
333
reportFinalizeError (direct );
336
334
if (!direct ) {
337
- return ;
335
+ return false ;
338
336
}
339
337
}
340
338
}
@@ -358,7 +356,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
358
356
PRINTF ("Plugin finalize call failed\n" );
359
357
reportFinalizeError (direct );
360
358
if (!direct ) {
361
- return ;
359
+ return false ;
362
360
}
363
361
}
364
362
// Lookup tokens if requested
@@ -384,7 +382,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
384
382
PRINTF ("Plugin provide token call failed\n" );
385
383
reportFinalizeError (direct );
386
384
if (!direct ) {
387
- return ;
385
+ return false ;
388
386
}
389
387
}
390
388
pluginFinalize .result = pluginProvideInfo .result ;
@@ -409,7 +407,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
409
407
PRINTF ("Incorrect amount/address set by plugin\n" );
410
408
reportFinalizeError (direct );
411
409
if (!direct ) {
412
- return ;
410
+ return false ;
413
411
}
414
412
}
415
413
memmove (tmpContent .txContent .value .value , pluginFinalize .amount , 32 );
@@ -425,7 +423,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
425
423
PRINTF ("ui type %d not supported\n" , pluginFinalize .uiType );
426
424
reportFinalizeError (direct );
427
425
if (!direct ) {
428
- return ;
426
+ return false ;
429
427
}
430
428
}
431
429
}
@@ -450,7 +448,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
450
448
reportFinalizeError (direct );
451
449
ui_warning_contract_data ();
452
450
if (!direct ) {
453
- return ;
451
+ return false ;
454
452
}
455
453
}
456
454
@@ -530,12 +528,16 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
530
528
// Prepare network field
531
529
get_network_as_string (strings .common .network_name , sizeof (strings .common .network_name ));
532
530
PRINTF ("Network: %s\n" , strings .common .network_name );
531
+ return true;
533
532
}
534
533
535
534
void finalizeParsing (bool direct ) {
536
- bool use_standard_UI ;
535
+ bool use_standard_UI = true ;
537
536
bool no_consent_check ;
538
- finalize_parsing_helper (direct , & use_standard_UI );
537
+
538
+ if (!finalize_parsing_helper (direct , & use_standard_UI )) {
539
+ return ;
540
+ }
539
541
// If called from swap, the user has already validated a standard transaction
540
542
// And we have already checked the fields of this transaction above
541
543
no_consent_check = G_called_from_swap && use_standard_UI ;
0 commit comments