-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Blindsigning for Large tx from settings
[tests]Update blindsign_different_modes accordingly
- Loading branch information
1 parent
d1f99a0
commit 8eb6afa
Showing
98 changed files
with
162 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,115 +28,95 @@ | |
#include "globals.h" | ||
#include "nbgl_use_case.h" | ||
|
||
static void controls_callback(int token, | ||
__attribute__((unused)) uint8_t index, | ||
__attribute__((unused)) int page); | ||
void tz_ui_home_redisplay(uint8_t page); | ||
void tz_ui_home_redisplay(void); | ||
|
||
// ----------------------------------------------------------- | ||
// --------------------- SETTINGS MENU ----------------------- | ||
// ----------------------------------------------------------- | ||
#define SETTING_INFO_NB 3 | ||
#define SETTINGS_SWITCHES_NB 1 | ||
#define SETTINGS_RADIO_NB 3 | ||
#define SETTING_INFO_NB 3 | ||
|
||
static const char *const infoTypes[] = {"Version", "Developer", "Contact"}; | ||
static const char *const infoContents[] = { | ||
APPVERSION, "Trilitech Kanvas Limited et al.", "[email protected]"}; | ||
|
||
enum { | ||
EXPERT_MODE_TOKEN = FIRST_USER_TOKEN, | ||
BLINDSIGN_MODE_TOKEN | ||
BLIND_SIGNING_TOKEN | ||
}; | ||
enum { | ||
EXPERT_MODE_TOKEN_ID = 0, | ||
BLINDSIGN_MODE_TOKEN_ID, | ||
SETTINGS_CONTENTS_NB | ||
}; | ||
enum { | ||
EXPERT_MODE_PAGE = 0, | ||
BLINDSIGN_PAGE = 1 | ||
BLIND_SIGNING_TOKEN_ID, | ||
SETTINGS_SWITCHES_NB | ||
}; | ||
|
||
static nbgl_contentSwitch_t expert_mode_switch = {0}; | ||
static nbgl_layoutSwitch_t switches[SETTINGS_SWITCHES_NB] = {0}; | ||
|
||
static const nbgl_contentInfoList_t infoList = {.nbInfos = SETTING_INFO_NB, | ||
.infoTypes = infoTypes, | ||
.infoContents = infoContents}; | ||
|
||
static const char *const blindsign_choices_text[] | ||
= {"Blindsign For Large Tx", "Blindsigning ON", "Blindsigning OFF"}; | ||
|
||
static void | ||
get_contents(uint8_t index, nbgl_content_t *content) | ||
{ | ||
FUNC_ENTER(("Index: %d", index)); | ||
if (index == EXPERT_MODE_TOKEN_ID) { | ||
content->content.switchesList.nbSwitches = SETTINGS_SWITCHES_NB; | ||
content->content.switchesList.switches = &expert_mode_switch; | ||
content->type = SWITCHES_LIST; | ||
content->contentActionCallback = controls_callback; | ||
} else { | ||
content->content.choicesList.nbChoices = SETTINGS_RADIO_NB; | ||
content->content.choicesList.names = blindsign_choices_text; | ||
content->content.choicesList.token = BLINDSIGN_MODE_TOKEN; | ||
content->content.choicesList.initChoice = N_settings.blindsign_status; | ||
content->type = CHOICES_LIST; | ||
content->contentActionCallback = controls_callback; | ||
} | ||
FUNC_LEAVE(); | ||
} | ||
|
||
static void | ||
controls_callback(int token, __attribute__((unused)) uint8_t index, | ||
__attribute__((unused)) int page) | ||
{ | ||
FUNC_ENTER(("Token : %d, Index: %d, Page: %d", token, index, page)); | ||
uint8_t switch_value; | ||
if (token == EXPERT_MODE_TOKEN) { | ||
if (token == BLIND_SIGNING_TOKEN) { | ||
switch_value = !N_settings.blindsigning; | ||
toggle_blindsigning(); | ||
switches[BLIND_SIGNING_TOKEN_ID].initState | ||
= (nbgl_state_t)(switch_value); | ||
} else if (token == EXPERT_MODE_TOKEN) { | ||
switch_value = !N_settings.expert_mode; | ||
toggle_expert_mode(); | ||
expert_mode_switch.initState = (nbgl_state_t)(switch_value); | ||
} | ||
if (token == BLINDSIGN_MODE_TOKEN) { | ||
blindsign_state_t blindsign_status = (blindsign_state_t)(index % 3); | ||
set_blindsign_status(blindsign_status); | ||
tz_ui_home_redisplay(BLINDSIGN_PAGE); | ||
switches[EXPERT_MODE_TOKEN_ID].initState | ||
= (nbgl_state_t)(switch_value); | ||
} | ||
FUNC_LEAVE(); | ||
} | ||
|
||
#define HOME_TEXT "This app enables signing transactions on the Tezos Network" | ||
#define SETTINGS_CONTENTS_NB 1 | ||
static const nbgl_content_t contentsList[SETTINGS_CONTENTS_NB] = { | ||
{.content.switchesList.nbSwitches = SETTINGS_SWITCHES_NB, | ||
.content.switchesList.switches = switches, | ||
.type = SWITCHES_LIST, | ||
.contentActionCallback = controls_callback} | ||
}; | ||
|
||
static const nbgl_genericContents_t tezos_settingContents | ||
= {.callbackCallNeeded = false, | ||
.contentsList = contentsList, | ||
.nbContents = SETTINGS_CONTENTS_NB}; | ||
; | ||
|
||
#define HOME_TEXT "This app enables signing transactions on the Tezos Network" | ||
void | ||
initSettings(void) | ||
{ | ||
expert_mode_switch.initState = (nbgl_state_t)(N_settings.expert_mode); | ||
expert_mode_switch.text = "Expert mode"; | ||
expert_mode_switch.subText = "Enable expert mode signing"; | ||
expert_mode_switch.token = EXPERT_MODE_TOKEN; | ||
expert_mode_switch.tuneId = TUNE_TAP_CASUAL; | ||
switches[EXPERT_MODE_TOKEN_ID].initState | ||
= (nbgl_state_t)(N_settings.expert_mode); | ||
switches[EXPERT_MODE_TOKEN_ID].text = "Expert mode"; | ||
switches[EXPERT_MODE_TOKEN_ID].subText = "Enable expert mode signing"; | ||
switches[EXPERT_MODE_TOKEN_ID].token = EXPERT_MODE_TOKEN; | ||
switches[EXPERT_MODE_TOKEN_ID].tuneId = TUNE_TAP_CASUAL; | ||
|
||
switches[BLIND_SIGNING_TOKEN_ID].initState | ||
= (nbgl_state_t)(N_settings.blindsigning); | ||
switches[BLIND_SIGNING_TOKEN_ID].text = "Blind signing"; | ||
switches[BLIND_SIGNING_TOKEN_ID].subText | ||
= "Enable transaction blind signing"; | ||
switches[BLIND_SIGNING_TOKEN_ID].token = BLIND_SIGNING_TOKEN; | ||
switches[BLIND_SIGNING_TOKEN_ID].tuneId = TUNE_TAP_CASUAL; | ||
} | ||
|
||
void | ||
tz_ui_home_redisplay(uint8_t page) | ||
tz_ui_home_redisplay(void) | ||
{ | ||
FUNC_ENTER(("void")); | ||
|
||
initSettings(); | ||
static nbgl_genericContents_t tezos_settingContents = {0}; | ||
tezos_settingContents.callbackCallNeeded = false; | ||
tezos_settingContents.nbContents = SETTINGS_CONTENTS_NB; | ||
|
||
static nbgl_content_t contents[SETTINGS_CONTENTS_NB] = {0}; | ||
get_contents(EXPERT_MODE_TOKEN_ID, &contents[EXPERT_MODE_TOKEN_ID]); | ||
get_contents(BLINDSIGN_MODE_TOKEN_ID, &contents[BLINDSIGN_MODE_TOKEN_ID]); | ||
|
||
tezos_settingContents.contentsList = contents; | ||
|
||
PRINTF("Entered settings and initialized\n"); | ||
|
||
nbgl_useCaseHomeAndSettings("Tezos Wallet", &C_tezos, HOME_TEXT, page, | ||
&tezos_settingContents, &infoList, NULL, | ||
app_exit); | ||
nbgl_useCaseHomeAndSettings("Tezos Wallet", &C_tezos, HOME_TEXT, | ||
INIT_HOME_PAGE, &tezos_settingContents, | ||
&infoList, NULL, app_exit); | ||
|
||
FUNC_LEAVE(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-10.7 KB
.../integration/touch/snapshots/flex/settings_BlindsigningStatus_Large_Tx_only.png
Binary file not shown.
Binary file removed
BIN
-10.7 KB
tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_OFF.png
Binary file not shown.
Binary file removed
BIN
-10.6 KB
tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_ON.png
Binary file not shown.
Binary file removed
BIN
-8.82 KB
tests/integration/touch/snapshots/flex/settings_expert_mode_off.png
Binary file not shown.
Binary file added
BIN
+13.1 KB
.../integration/touch/snapshots/flex/settings_expert_mode_off_blindsigning_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.1 KB
...s/integration/touch/snapshots/flex/settings_expert_mode_off_blindsigning_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added
BIN
+13 KB
...s/integration/touch/snapshots/flex/settings_expert_mode_on_blindsigning_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13 KB
tests/integration/touch/snapshots/flex/settings_expert_mode_on_blindsigning_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-16.1 KB
...hots/flex/test_blindsign_different_modes/blindsign_warning_too_many_screens.png
Binary file not shown.
Binary file removed
BIN
-18.9 KB
...tion/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_9.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+19.7 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_3_1.png
Oops, something went wrong.
File renamed without changes
Binary file added
BIN
+19 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_3_3.png
Oops, something went wrong.
Binary file added
BIN
+19.6 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_3_4.png
Oops, something went wrong.
Binary file added
BIN
+19.7 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_3_5.png
Oops, something went wrong.
Binary file added
BIN
+19.9 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_4_1.png
Oops, something went wrong.
Binary file added
BIN
+20.8 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_4_2.png
Oops, something went wrong.
Binary file added
BIN
+8.97 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_screen_skip_4_3.png
Oops, something went wrong.
Binary file removed
BIN
-12.8 KB
...on/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_3.png
Diff not rendered.
Binary file removed
BIN
-9.76 KB
.../integration/touch/snapshots/stax/settings_BlindsigningStatus_Large_Tx_only.png
Diff not rendered.
Binary file removed
BIN
-9.72 KB
tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_OFF.png
Diff not rendered.
Binary file removed
BIN
-9.68 KB
tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_ON.png
Diff not rendered.
Binary file removed
BIN
-8.06 KB
tests/integration/touch/snapshots/stax/settings_expert_mode_off.png
Diff not rendered.
Binary file added
BIN
+11.6 KB
.../integration/touch/snapshots/stax/settings_expert_mode_off_blindsigning_off.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...s/integration/touch/snapshots/stax/settings_expert_mode_off_blindsigning_on.png
Oops, something went wrong.
Diff not rendered.
Binary file added
BIN
+11.5 KB
...s/integration/touch/snapshots/stax/settings_expert_mode_on_blindsigning_off.png
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
tests/integration/touch/snapshots/stax/settings_expert_mode_on_blindsigning_on.png
Oops, something went wrong.
Binary file removed
BIN
-14.5 KB
...hots/stax/test_blindsign_different_modes/blindsign_warning_too_many_screens.png
Diff not rendered.
Binary file removed
BIN
-17.3 KB
...ion/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_11.png
Diff not rendered.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+16.5 KB
...gration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_screen_2_2.png
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+19.7 KB
...on/touch/snapshots/stax/test_blindsign_different_modes/tbdm_screen_skip_3_1.png
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+17.8 KB
...on/touch/snapshots/stax/test_blindsign_different_modes/tbdm_screen_skip_3_5.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...on/touch/snapshots/stax/test_blindsign_different_modes/tbdm_screen_skip_4_1.png
Oops, something went wrong.
Binary file added
BIN
+15.7 KB
...on/touch/snapshots/stax/test_blindsign_different_modes/tbdm_screen_skip_4_2.png
Oops, something went wrong.
Binary file removed
BIN
-9.16 KB
...n/touch/snapshots/stax/test_blindsign_too_deep/blindsign_review_transaction.png
Diff not rendered.
Binary file removed
BIN
-14.7 KB
...ion/touch/snapshots/stax/test_blindsign_too_deep/blindsign_warning_ledger_1.png
Diff not rendered.
Binary file removed
BIN
-3.87 KB
.../integration/touch/snapshots/stax/test_blindsign_too_deep/loading_operation.png
Diff not rendered.
Binary file removed
BIN
-9.7 KB
...ation/touch/snapshots/stax/test_blindsign_too_deep/operation_sign_blindsign.png
Diff not rendered.
Binary file removed
BIN
-6.07 KB
...integration/touch/snapshots/stax/test_blindsign_too_deep/signing_successful.png
Diff not rendered.
Binary file removed
BIN
-5.31 KB
tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_0.png
Diff not rendered.
Binary file removed
BIN
-16.1 KB
tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_1.png
Diff not rendered.
Binary file removed
BIN
-16.1 KB
...ration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_0.png
Diff not rendered.
Binary file removed
BIN
-6.12 KB
...ion/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png
Diff not rendered.
Binary file removed
BIN
-9.16 KB
...on/touch/snapshots/stax/test_blindsign_too_deep/tbtd_start_review_blindsign.png
Diff not rendered.
Binary file removed
BIN
-13.7 KB
...ion/touch/snapshots/stax/test_blindsign_too_deep/too_deep_blindsign_warning.png
Diff not rendered.
Binary file removed
BIN
-13.7 KB
...ion/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_1.png
Diff not rendered.
Binary file removed
BIN
-14.7 KB
...ion/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_2.png
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.