Add a UI warning when contract data are not enabled in the settings (#193)
* Add a UI warning when contract data are not enabled in the settings * Update wording "contract data" -> "blind signing" to raise awareness * Bump version 1.9.5 * remove hardcoded path in helper build script * Add blind signature test * Add snapshot-tmp to gitignore * Remove unused snapshots * Increase tests timings * Remove unused snapshots * Fix and rename compound blind deposit test * Update Approve and Transfer tests * Update tests * Cosmetic changes + disable debug flag * Update CHANGELOG.md
This commit is contained in:
@@ -92,6 +92,10 @@ void ui_idle(void) {
|
||||
ux_flow_init(0, ux_idle_flow, NULL);
|
||||
}
|
||||
|
||||
void ui_warning_contract_data(void) {
|
||||
ux_flow_init(0, ux_warning_contract_data_flow, NULL);
|
||||
}
|
||||
|
||||
unsigned int io_seproxyhal_touch_exit(__attribute__((unused)) const bagl_element_t *e) {
|
||||
// Go back to the dashboard
|
||||
os_sched_exit(0);
|
||||
|
||||
@@ -16,6 +16,7 @@ unsigned int io_seproxyhal_touch_signMessage712_v0_cancel(const bagl_element_t *
|
||||
unsigned int io_seproxyhal_touch_eth2_address_ok(const bagl_element_t *e);
|
||||
|
||||
void ui_idle(void);
|
||||
void ui_warning_contract_data(void);
|
||||
|
||||
void io_seproxyhal_send_status(uint32_t sw);
|
||||
void format_signature_out(const uint8_t *signature);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void display_settings(const ux_flow_step_t* const start_step);
|
||||
void switch_settings_contract_data(void);
|
||||
void switch_settings_blind_signing(void);
|
||||
void switch_settings_display_data(void);
|
||||
void switch_settings_display_nonce(void);
|
||||
|
||||
@@ -54,9 +54,9 @@ UX_FLOW(ux_idle_flow,
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_1_step,
|
||||
bnnn_paging,
|
||||
switch_settings_contract_data(),
|
||||
switch_settings_blind_signing(),
|
||||
{
|
||||
.title = "Contract data",
|
||||
.title = "Blind signing",
|
||||
.text = strings.common.fullAddress,
|
||||
});
|
||||
|
||||
@@ -83,11 +83,11 @@ UX_STEP_CB(
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_1_step,
|
||||
bnnn,
|
||||
switch_settings_contract_data(),
|
||||
switch_settings_blind_signing(),
|
||||
{
|
||||
"Contract data",
|
||||
"Allow contract data",
|
||||
"in transactions",
|
||||
"Blind signing",
|
||||
"Enable transaction",
|
||||
"blind signing",
|
||||
strings.common.fullAddress,
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ UX_FLOW(ux_settings_flow,
|
||||
&ux_settings_flow_4_step);
|
||||
|
||||
void display_settings(const ux_flow_step_t* const start_step) {
|
||||
strlcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"), 12);
|
||||
strlcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Enabled" : "NOT Enabled"), 12);
|
||||
strlcpy(strings.common.fullAddress + 12,
|
||||
(N_storage.contractDetails ? "Displayed" : "NOT Displayed"),
|
||||
26 - 12);
|
||||
@@ -142,7 +142,7 @@ void display_settings(const ux_flow_step_t* const start_step) {
|
||||
ux_flow_init(0, ux_settings_flow, start_step);
|
||||
}
|
||||
|
||||
void switch_settings_contract_data() {
|
||||
void switch_settings_blind_signing() {
|
||||
uint8_t value = (N_storage.dataAllowed ? 0 : 1);
|
||||
nvm_write((void*) &N_storage.dataAllowed, (void*) &value, sizeof(uint8_t));
|
||||
display_settings(&ux_settings_flow_1_step);
|
||||
@@ -159,3 +159,29 @@ void switch_settings_display_nonce() {
|
||||
nvm_write((void*) &N_storage.displayNonce, (void*) &value, sizeof(uint8_t));
|
||||
display_settings(&ux_settings_flow_3_step);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// clang-format off
|
||||
#if defined(TARGET_NANOS)
|
||||
UX_STEP_CB(
|
||||
ux_warning_contract_data_step,
|
||||
bnnn_paging,
|
||||
ui_idle(),
|
||||
{
|
||||
"Error",
|
||||
"Blind signing must be enabled in Settings",
|
||||
});
|
||||
#elif defined(TARGET_NANOX)
|
||||
UX_STEP_CB(
|
||||
ux_warning_contract_data_step,
|
||||
pnn,
|
||||
ui_idle(),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Blind signing must be",
|
||||
"enabled in Settings",
|
||||
});
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_warning_contract_data_flow, &ux_warning_contract_data_step);
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
extern const ux_flow_step_t* const ux_idle_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_warning_contract_data_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_settings_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_display_public_flow[];
|
||||
|
||||
Reference in New Issue
Block a user