eth: split ux from rest of source
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "shared_context.h"
|
||||
#include "apdu_constants.h"
|
||||
#include "utils.h"
|
||||
#include "ui_flow.h"
|
||||
#include "common_ui.h"
|
||||
|
||||
void handleSignEIP712Message(uint8_t p1,
|
||||
uint8_t p2,
|
||||
@@ -29,7 +29,7 @@ void handleSignEIP712Message(uint8_t p1,
|
||||
#ifdef NO_CONSENT
|
||||
io_seproxyhal_touch_signMessage_ok(NULL);
|
||||
#else // NO_CONSENT
|
||||
ux_flow_init(0, ux_sign_712_v0_flow, NULL);
|
||||
ui_sign_712_v0();
|
||||
#endif // NO_CONSENT
|
||||
|
||||
*flags |= IO_ASYNCH_REPLY;
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void prepare_domain_hash_v0() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.domainHash);
|
||||
}
|
||||
|
||||
void prepare_message_hash_v0() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.messageHash);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
UX_STEP_NOCB(
|
||||
ux_sign_712_v0_flow_1_step,
|
||||
pnn,
|
||||
{
|
||||
&C_icon_certificate,
|
||||
"Sign",
|
||||
"typed message",
|
||||
});
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_sign_712_v0_flow_2_step,
|
||||
bnnn_paging,
|
||||
prepare_domain_hash_v0(),
|
||||
{
|
||||
.title = "Domain hash",
|
||||
.text = strings.tmp.tmp,
|
||||
});
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_sign_712_v0_flow_3_step,
|
||||
bnnn_paging,
|
||||
prepare_message_hash_v0(),
|
||||
{
|
||||
.title = "Message hash",
|
||||
.text = strings.tmp.tmp,
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_sign_712_v0_flow_4_step,
|
||||
pbb,
|
||||
io_seproxyhal_touch_signMessage712_v0_ok(NULL),
|
||||
{
|
||||
&C_icon_validate_14,
|
||||
"Sign",
|
||||
"message",
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_sign_712_v0_flow_5_step,
|
||||
pbb,
|
||||
io_seproxyhal_touch_signMessage712_v0_cancel(NULL),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Cancel",
|
||||
"signature",
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_sign_712_v0_flow,
|
||||
&ux_sign_712_v0_flow_1_step,
|
||||
&ux_sign_712_v0_flow_2_step,
|
||||
&ux_sign_712_v0_flow_3_step,
|
||||
&ux_sign_712_v0_flow_4_step,
|
||||
&ux_sign_712_v0_flow_5_step);
|
||||
Reference in New Issue
Block a user