Skip to content

Commit

Permalink
[blind] remove LARGE_TX option for touch devices
Browse files Browse the repository at this point in the history
 - OFF is the default value

Co-authored-by: Ajinkya <[email protected]>
  • Loading branch information
spalmer25 and ajinkyaraj-23 committed Oct 1, 2024
1 parent 5886bac commit c054190
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 32 deletions.
8 changes: 1 addition & 7 deletions app/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,8 @@ typedef enum {
} main_step_t;

typedef enum {
#ifdef HAVE_BAGL
ST_BLINDSIGN_OFF = 0,
ST_BLINDSIGN_ON
#else
ST_BLINDSIGN_LARGE_TX = 0,
ST_BLINDSIGN_ON = 1,
ST_BLINDSIGN_OFF = 2
#endif
} blindsign_state_t;

#ifdef TARGET_NANOS
Expand Down Expand Up @@ -156,5 +150,5 @@ void toggle_expert_mode(void);
/// Toggles the persisted blindsign setting between "OFF", "ON".
void toggle_blindsign_status(void);

/// set the blindsign setting between "For large tx", "ON", "OFF".
/// set the blindsign setting between "OFF", "ON".
void set_blindsign_status(blindsign_state_t status);
6 changes: 3 additions & 3 deletions app/src/ui_home_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void tz_ui_home_redisplay(uint8_t page);
// -----------------------------------------------------------
#define SETTING_INFO_NB 3
#define SETTINGS_SWITCHES_NB 1
#define SETTINGS_RADIO_NB 3
#define SETTINGS_RADIO_NB 2
static const char *const infoTypes[] = {"Version", "Developer", "Contact"};
static const char *const infoContents[] = {
APPVERSION, "Trilitech Kanvas Limited et al.", "[email protected]"};
Expand All @@ -63,7 +63,7 @@ static const nbgl_contentInfoList_t infoList = {.nbInfos = SETTING_INFO_NB,
.infoContents = infoContents};

static const char *const blindsign_choices_text[]
= {"Blindsign For Large Tx", "Blindsigning ON", "Blindsigning OFF"};
= {"Blindsigning OFF", "Blindsigning ON"};

static void
get_contents(uint8_t index, nbgl_content_t *content)
Expand Down Expand Up @@ -97,7 +97,7 @@ controls_callback(int token, __attribute__((unused)) uint8_t index,
expert_mode_switch.initState = (nbgl_state_t)(switch_value);
}
if (token == BLINDSIGN_MODE_TOKEN) {
blindsign_state_t blindsign_status = (blindsign_state_t)(index % 3);
blindsign_state_t blindsign_status = (blindsign_state_t)(index % 2);
set_blindsign_status(blindsign_status);
tz_ui_home_redisplay(BLINDSIGN_PAGE);
}
Expand Down
Binary file not shown.
Binary file modified tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_OFF.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions tests/integration/touch/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

app.assert_home()

app.welcome.settings()
app.set_expert_mode(initial_status=False)
app.set_expert_mode(initial_status=True)
app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only)
app.set_blindsigning_status(BlindsigningStatus.ON)
app.set_blindsigning_status(BlindsigningStatus.OFF)

Expand Down
9 changes: 0 additions & 9 deletions tests/integration/touch/test_blindsign_different_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ def blindsign_review_sign(app: TezosAppScreen):
else:
navigate_common(app, skip=False, group_counts=[4, 2, 5, 3])

# Blindsign status For Large Tx only
app.assert_home()
app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only)

if(app.firmware == Firmware.STAX):
navigate_common(app, skip=False, group_counts=[3, 1, 6, 2])
else:
navigate_common(app, skip=False, group_counts=[4, 2, 5, 3])

# Blindsign status ON
app.assert_home()
app.set_blindsigning_status(BlindsigningStatus.ON)
Expand Down
16 changes: 5 additions & 11 deletions tests/integration/touch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ def show_qr(self) -> None:


class BlindsigningStatus(Enum):
Large_Tx_only = 1
OFF = 1
ON = 2
OFF = 3

class BlindsigningType(Enum):
NO_BLINDSIGN = 0
Expand All @@ -159,11 +158,9 @@ def toggle_expert_mode(self):
self._toggle_list.choose(1)

def set_blindigning(self, status: BlindsigningStatus):
if status == BlindsigningStatus.Large_Tx_only:
if self.firmware == Firmware.STAX:
self.client.finger_touch(200, 180)
else:
self.client.finger_touch(240, 140)
if status == BlindsigningStatus.OFF and \
self.firmware == Firmware.STAX:
self.client.finger_touch(200, 180)
else:
self._toggle_list.choose(status.value)

Expand Down Expand Up @@ -242,9 +239,6 @@ def remove_expert_mode_pages(self):
def remove_blindsigning_pages(self):
""" Delete the blindsigning pages for golden tests"""
if self.__golden:
blindsigning_path=os.path.join(self.__snapshots_path, "settings_BlindsigningStatus_Large_Tx_only.png")
if os.path.exists(blindsigning_path):
os.remove(blindsigning_path)
blindsigning_path=os.path.join(self.__snapshots_path, "settings_BlindsigningStatus_ON.png")
if os.path.exists(blindsigning_path):
os.remove(blindsigning_path)
Expand Down Expand Up @@ -304,7 +298,7 @@ def assert_expert_mode(self, expert_mode=False):
suffix += "_expert_on"
self.assert_screen("settings" + suffix)

def assert_blindsigning_status(self, blindsignStatus=BlindsigningStatus.Large_Tx_only):
def assert_blindsigning_status(self, blindsignStatus=BlindsigningStatus.OFF):
suffix = "settings_" + str(blindsignStatus).replace(".", "_")
self.assert_screen(suffix, True)

Expand Down

0 comments on commit c054190

Please sign in to comment.