Downgrade to make the app fit on LNS

This commit is contained in:
Alexandre Paillier
2022-09-15 16:32:26 +02:00
parent 971a02dfcf
commit ba34e37bce
16 changed files with 26 additions and 4 deletions

View File

@@ -7,13 +7,18 @@ static uint8_t ui_pos;
static void dummy_pre_cb(void) {
if (ui_pos == UI_191_POS_REVIEW) {
#ifdef TARGET_NANOS
skip_rest_of_message();
#else
question_switcher();
#endif
} else {
ux_flow_prev();
ui_pos = UI_191_POS_REVIEW;
}
}
#ifndef TARGET_NANOS
static void dummy_post_cb(void) {
if (ui_pos == UI_191_POS_QUESTION) {
continue_displaying_message();
@@ -22,6 +27,7 @@ static void dummy_post_cb(void) {
ui_191_switch_to_message_end();
}
}
#endif
// clang-format off
UX_STEP_NOCB(
@@ -46,6 +52,7 @@ UX_STEP_INIT(
{
dummy_pre_cb();
});
#ifndef TARGET_NANOS
UX_STEP_CB(
ux_191_step_theres_more,
bn,
@@ -61,6 +68,7 @@ UX_STEP_INIT(
{
dummy_post_cb();
});
#endif
UX_STEP_CB(
ux_191_step_sign,
pbb,
@@ -85,8 +93,10 @@ UX_FLOW(ux_191_flow,
&ux_191_step_review,
&ux_191_step_message,
&ux_191_step_dummy_pre,
#ifndef TARGET_NANOS
&ux_191_step_theres_more,
&ux_191_step_dummy_post,
#endif
&ux_191_step_sign,
&ux_191_step_cancel);
@@ -100,18 +110,22 @@ void ui_191_switch_to_message(void) {
ui_pos = UI_191_POS_REVIEW;
}
#ifndef TARGET_NANOS
void ui_191_switch_to_message_end(void) {
// Force it to a value that will make it automatically do a prev()
ui_pos = UI_191_POS_QUESTION;
ux_flow_init(0, ux_191_flow, &ux_191_step_dummy_pre);
}
#endif
void ui_191_switch_to_sign(void) {
ux_flow_init(0, ux_191_flow, &ux_191_step_sign);
ui_pos = UI_191_POS_END;
}
#ifndef TARGET_NANOS
void ui_191_switch_to_question(void) {
ux_flow_init(0, ux_191_flow, &ux_191_step_theres_more);
ui_pos = UI_191_POS_QUESTION;
}
#endif

View File

@@ -177,13 +177,17 @@ static void feed_display(void) {
processed_size += 1;
} else {
// fill the rest of the UI buffer spaces, to consider the buffer full
while (remaining_ui_buffer_length()) {
sprintf(remaining_ui_buffer(), " ");
}
memset(remaining_ui_buffer(), ' ', remaining_ui_buffer_length());
}
}
}
#ifdef TARGET_NANOS
if ((remaining_ui_buffer_length() == 0) && (unprocessed_length > 0)) {
sprintf(remaining_ui_buffer() - 3, "...");
}
#endif
if ((remaining_ui_buffer_length() == 0) ||
(tmpCtx.messageSigningContext.remainingLength == 0)) {
if (!states.ui_started) {
@@ -248,6 +252,7 @@ bool handleSignPersonalMessage(uint8_t p1,
return true;
}
#ifndef TARGET_NANOS
/**
* Decide whether to show the question to show more of the message or not
*/
@@ -260,6 +265,7 @@ void question_switcher(void) {
ui_191_switch_to_sign();
}
}
#endif
/**
* The user has decided to skip the rest of the message
@@ -273,6 +279,7 @@ void skip_rest_of_message(void) {
}
}
#ifndef TARGET_NANOS
/**
* The user has decided to see the next chunk of the message
*/
@@ -282,3 +289,4 @@ void continue_displaying_message(void) {
feed_display();
}
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

View File

@@ -56,7 +56,7 @@ nano_models.forEach(function(model) {
if (model.letter == 'S')
{
await sim.navigateAndCompareSnapshots('.', model.name + '_eip191_opensea', [1, 5, 1, 6, 0, 1, -1, 0]);
await sim.navigateAndCompareSnapshots('.', model.name + '_eip191_opensea', [1, 5, 1, -1, 0]);
}
else
{