Skip to content

Commit db8b202

Browse files
Unlink NBGL implementations of EIP-712 v0 and full
App would not build if full implem was disabled
1 parent dbcc279 commit db8b202

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src_nbgl/ui_message_signing.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
#include "ui_nbgl.h"
22
#include "ui_logic.h"
3+
#include "common_712.h"
34

4-
void ui_typed_message_review_choice(bool confirm) {
5+
static void ui_typed_message_review_choice_common(bool confirm,
6+
unsigned int (*approve_func)(),
7+
unsigned int (*reject_func)()) {
58
if (confirm) {
6-
ui_712_approve();
9+
approve_func();
710
nbgl_useCaseReviewStatus(STATUS_TYPE_MESSAGE_SIGNED, ui_idle);
811
} else {
9-
ui_712_reject();
12+
reject_func();
1013
nbgl_useCaseReviewStatus(STATUS_TYPE_MESSAGE_REJECTED, ui_idle);
1114
}
1215
}
16+
17+
void ui_typed_message_review_choice_v0(bool confirm) {
18+
ui_typed_message_review_choice_common(confirm, ui_712_approve_cb, ui_712_reject_cb);
19+
}
20+
21+
#ifdef HAVE_EIP712_FULL_SUPPORT
22+
void ui_typed_message_review_choice(bool confirm) {
23+
ui_typed_message_review_choice_common(confirm, ui_712_approve, ui_712_reject);
24+
}
25+
#endif

src_nbgl/ui_message_signing.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#define TEXT_SIGN_EIP712 SIGN(TEXT_TYPED_MESSAGE)
1111
#define TEXT_BLIND_SIGN_EIP712 BLIND_SIGN(TEXT_TYPED_MESSAGE)
1212

13+
void ui_typed_message_review_choice_v0(bool confirm);
14+
#ifdef HAVE_EIP712_FULL_SUPPORT
1315
void ui_typed_message_review_choice(bool confirm);
16+
#endif
1417

1518
#endif // UI_MESSAGE_SIGNING_H_

src_nbgl/ui_sign_712_v0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ void ui_sign_712_v0(void) {
3939
NULL,
4040
TEXT_BLIND_SIGN_EIP712,
4141
NULL,
42-
ui_typed_message_review_choice);
42+
ui_typed_message_review_choice_v0);
4343
}

0 commit comments

Comments
 (0)