diff --git a/src_nbgl/ui_message_signing.c b/src_nbgl/ui_message_signing.c index ff18abb9f..ed4fd8a57 100644 --- a/src_nbgl/ui_message_signing.c +++ b/src_nbgl/ui_message_signing.c @@ -1,12 +1,25 @@ #include "ui_nbgl.h" #include "ui_logic.h" +#include "common_712.h" -void ui_typed_message_review_choice(bool confirm) { +static void ui_typed_message_review_choice_common(bool confirm, + unsigned int (*approve_func)(), + unsigned int (*reject_func)()) { if (confirm) { - ui_712_approve(); + approve_func(); nbgl_useCaseReviewStatus(STATUS_TYPE_MESSAGE_SIGNED, ui_idle); } else { - ui_712_reject(); + reject_func(); nbgl_useCaseReviewStatus(STATUS_TYPE_MESSAGE_REJECTED, ui_idle); } } + +void ui_typed_message_review_choice_v0(bool confirm) { + ui_typed_message_review_choice_common(confirm, ui_712_approve_cb, ui_712_reject_cb); +} + +#ifdef HAVE_EIP712_FULL_SUPPORT +void ui_typed_message_review_choice(bool confirm) { + ui_typed_message_review_choice_common(confirm, ui_712_approve, ui_712_reject); +} +#endif diff --git a/src_nbgl/ui_message_signing.h b/src_nbgl/ui_message_signing.h index cbdb7b22c..8c8c193b7 100644 --- a/src_nbgl/ui_message_signing.h +++ b/src_nbgl/ui_message_signing.h @@ -10,6 +10,9 @@ #define TEXT_SIGN_EIP712 SIGN(TEXT_TYPED_MESSAGE) #define TEXT_BLIND_SIGN_EIP712 BLIND_SIGN(TEXT_TYPED_MESSAGE) +void ui_typed_message_review_choice_v0(bool confirm); +#ifdef HAVE_EIP712_FULL_SUPPORT void ui_typed_message_review_choice(bool confirm); +#endif #endif // UI_MESSAGE_SIGNING_H_ diff --git a/src_nbgl/ui_sign_712_v0.c b/src_nbgl/ui_sign_712_v0.c index 4b8489e51..64bc640f5 100644 --- a/src_nbgl/ui_sign_712_v0.c +++ b/src_nbgl/ui_sign_712_v0.c @@ -39,5 +39,5 @@ void ui_sign_712_v0(void) { NULL, TEXT_BLIND_SIGN_EIP712, NULL, - ui_typed_message_review_choice); + ui_typed_message_review_choice_v0); }