Fix EIP-712 Ragger tests

This commit is contained in:
Alexandre Paillier
2024-07-16 11:33:17 +02:00
parent 978d6dcb12
commit 0a2071d07f
14 changed files with 11 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -129,16 +129,25 @@ def eip712_new_common(firmware: Firmware,
moves = [NavInsID.RIGHT_CLICK] * 2
moves += [NavInsID.BOTH_CLICK]
else:
# need to skip the message hash
# this move is necessary most of the times, but can't be 100% sure with the fields grouping
moves += [NavInsID.SWIPE_CENTER_TO_LEFT]
# need to skip the message hash
if not verbose and filters is None:
moves += [NavInsID.SWIPE_CENTER_TO_LEFT]
moves += [NavInsID.USE_CASE_REVIEW_CONFIRM]
if SNAPS_CONFIG is not None:
# Could break (time-out) if given a JSON that requires less moves
# TODO: Maybe take list of moves as input instead of trying to guess them ?
navigator.navigate_and_compare(default_screenshot_path,
SNAPS_CONFIG.test_name,
moves,
snap_start_idx=SNAPS_CONFIG.idx)
else:
navigator.navigate(moves)
# Do them one-by-one to prevent an unnecessary move from timing-out and failing the test
for move in moves:
navigator.navigate([move],
screen_change_before_first_instruction=False,
screen_change_after_last_instruction=False)
return ResponseParser.signature(app_client.response().data)