Removed large global buffer from NBGL transaction signing UI code

This commit is contained in:
Alexandre Paillier
2023-05-05 14:57:58 +02:00
parent 7c07008335
commit 1413547d3e

View File

@@ -20,7 +20,6 @@ static nbgl_layoutTagValue_t pair;
// these buffers are used as circular
static char title_buffer[MAX_PLUGIN_ITEMS_PER_SCREEN][TAG_MAX_LEN];
static char msg_buffer[MAX_PLUGIN_ITEMS_PER_SCREEN][VALUE_MAX_LEN];
static char transaction_type[100];
static nbgl_layoutTagValueList_t useCaseTagValueList;
static nbgl_pageInfoLongPress_t infoLongPress;
@@ -212,7 +211,7 @@ static void reviewContinueCommon(void) {
useCaseTagValueList.smallCaseForValue = false;
useCaseTagValueList.wrapping = false;
infoLongPress.icon = get_app_icon(true);
infoLongPress.text = tx_approval_context.fromPlugin ? transaction_type : "Review transaction";
infoLongPress.text = tx_approval_context.fromPlugin ? staxSharedBuffer : "Review transaction";
infoLongPress.longPressText = "Hold to sign";
nbgl_useCaseStaticReview(&useCaseTagValueList,
&infoLongPress,
@@ -223,12 +222,12 @@ static void reviewContinueCommon(void) {
static void buildFirstPage(void) {
if (tx_approval_context.fromPlugin) {
plugin_ui_get_id();
SPRINTF(transaction_type,
SPRINTF(staxSharedBuffer,
"Review %s\ntransaction:\n%s",
strings.common.fullAddress,
strings.common.fullAmount);
nbgl_useCaseReviewStart(get_app_icon(true),
transaction_type,
staxSharedBuffer,
NULL,
"Reject transaction",
reviewContinue,