Skip to content

Commit

Permalink
Merge pull request trilitech#264 from trilitech/palmer@functori@bump-…
Browse files Browse the repository at this point in the history
…ledger-app-builder-version

Bump `ledger-app-builder` version
  • Loading branch information
ajinkyaraj-23 authored Jul 25, 2024
2 parents 60e819d + ee7c2fe commit b4d7a8b
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions tests/integration/touch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
UseCaseSettings as OriginalUseCaseSettings,
UseCaseAddressConfirmation as OriginalUseCaseAddressConfirmation,
UseCaseReview as OriginalUseCaseReview,
UseCaseChoice as OriginalUseCaseChoice
UseCaseChoice
)
from ragger.firmware.touch.layouts import ChoiceList
from ragger.firmware.touch.positions import (
Expand All @@ -58,17 +58,6 @@ def with_retry(f, attempts=MAX_ATTEMPTS):
# Give plenty of time for speculos to update - can take a long time on CI machines
time.sleep(0.5)

class UseCaseChoice(OriginalUseCaseChoice):
"""Extension of UseCaseChoice for our app."""

# Fixed in Ragger v1.21.0
def reject(self) -> None:
"""Tap on reject button."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*STAX_BUTTON_LOWER_LEFT)
if self.firmware == Firmware.FLEX:
super().reject()

class UseCaseReview(OriginalUseCaseReview):
"""Extension of UseCaseReview for our app."""

Expand All @@ -89,30 +78,6 @@ def next(self) -> None:
"""Pass to the next screen."""
self._center.swipe_left()

# Fixed in Ragger v1.21.0
def tap(self) -> None:
"""Tap on screen."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*STAX_BUTTON_LOWER_RIGHT)
if self.firmware == Firmware.FLEX:
super().tap()

# Fixed in Ragger v1.21.0
def previous(self) -> None:
"""Tap on screen."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*STAX_BUTTON_LOWER_MIDDLE)
if self.firmware == Firmware.FLEX:
super().previous()

# Fixed in Ragger v1.21.0
def reject(self) -> None:
"""Tap on reject button."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*STAX_BUTTON_LOWER_LEFT)
if self.firmware == Firmware.FLEX:
super().reject()

class UseCaseAddressConfirmation(OriginalUseCaseAddressConfirmation):
"""Extension of UseCaseAddressConfirmation for our app."""

Expand Down Expand Up @@ -140,14 +105,6 @@ def show_qr(self) -> None:
"""Tap to show qr code."""
self.client.finger_touch(*self.qr_position)

# Fixed in Ragger v1.21.0
def cancel(self) -> None:
"""Tap on cancel button."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*STAX_BUTTON_LOWER_LEFT)
if self.firmware == Firmware.FLEX:
super().cancel()

class UseCaseSettings(OriginalUseCaseSettings):
"""Extension of UseCaseSettings for our app."""

Expand All @@ -169,15 +126,6 @@ def exit(self) -> None:
"""Exits settings."""
self.multi_page_exit()

# Fixed in Ragger v1.21.0
STAX_BUTTON_LOWER_MIDDLE_RIGHT = Position(266, 615)
def previous(self) -> None:
"""Tap on cancel button."""
if self.firmware == Firmware.STAX:
self.client.finger_touch(*UseCaseSettings.STAX_BUTTON_LOWER_MIDDLE_RIGHT)
if self.firmware == Firmware.FLEX:
super().previous()

class TezosAppScreen(metaclass=MetaScreen):
use_case_welcome = UseCaseHomeExt
use_case_settings = UseCaseSettings
Expand Down

0 comments on commit b4d7a8b

Please sign in to comment.