Port scenario review in 'test_eip191'
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 497 B |
|
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 623 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 623 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 457 B |
|
After Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 917 B |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 526 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 457 B |
|
After Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 857 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 857 B |
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 832 B |
|
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 720 B |
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 850 B |
|
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 626 B |
|
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 621 B |
|
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 912 B |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 692 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 457 B |
|
After Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 418 B |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -8,15 +8,14 @@ from client.utils import recover_message
|
||||
from ragger.error import ExceptionRAPDU
|
||||
from ragger.backend import BackendInterface
|
||||
from ragger.firmware import Firmware
|
||||
from ragger.navigator import Navigator, NavInsID
|
||||
from ragger.navigator.navigation_scenario import NavigateWithScenario
|
||||
|
||||
|
||||
BIP32_PATH = "m/44'/60'/0'/0/0"
|
||||
|
||||
|
||||
def test_personal_sign_metamask(firmware: Firmware,
|
||||
backend: BackendInterface,
|
||||
navigator: Navigator,
|
||||
def test_personal_sign_metamask(backend: BackendInterface,
|
||||
scenario_navigator: NavigateWithScenario,
|
||||
test_name: str,
|
||||
default_screenshot_path: Path):
|
||||
|
||||
@@ -29,22 +28,7 @@ def test_personal_sign_metamask(firmware: Firmware,
|
||||
_, DEVICE_ADDR, _ = ResponseParser.pk_addr(app_client.response().data)
|
||||
|
||||
with app_client.personal_sign(BIP32_PATH, msg.encode('utf-8')):
|
||||
if firmware.device.startswith("nano"):
|
||||
next_action = NavInsID.RIGHT_CLICK
|
||||
confirm_action = NavInsID.BOTH_CLICK
|
||||
initial_instructions = [NavInsID.RIGHT_CLICK]
|
||||
# Skip 1st screen because 'Sign' is already present
|
||||
navigator.navigate(initial_instructions,
|
||||
screen_change_after_last_instruction=False)
|
||||
else:
|
||||
next_action = NavInsID.USE_CASE_REVIEW_TAP
|
||||
confirm_action = NavInsID.USE_CASE_REVIEW_CONFIRM
|
||||
|
||||
navigator.navigate_until_text_and_compare(next_action,
|
||||
[confirm_action],
|
||||
"Sign",
|
||||
default_screenshot_path,
|
||||
test_name)
|
||||
scenario_navigator.review_approve(default_screenshot_path, test_name, "Sign")
|
||||
|
||||
# verify signature
|
||||
vrs = ResponseParser.signature(app_client.response().data)
|
||||
@@ -52,9 +36,8 @@ def test_personal_sign_metamask(firmware: Firmware,
|
||||
assert addr == DEVICE_ADDR
|
||||
|
||||
|
||||
def test_personal_sign_non_ascii(firmware: Firmware,
|
||||
backend: BackendInterface,
|
||||
navigator: Navigator,
|
||||
def test_personal_sign_non_ascii(backend: BackendInterface,
|
||||
scenario_navigator: NavigateWithScenario,
|
||||
test_name: str,
|
||||
default_screenshot_path: Path):
|
||||
|
||||
@@ -67,23 +50,7 @@ def test_personal_sign_non_ascii(firmware: Firmware,
|
||||
_, DEVICE_ADDR, _ = ResponseParser.pk_addr(app_client.response().data)
|
||||
|
||||
with app_client.personal_sign(BIP32_PATH, msg.encode('utf-8')):
|
||||
if firmware.device.startswith("nano"):
|
||||
next_action = NavInsID.RIGHT_CLICK
|
||||
confirm_action = NavInsID.BOTH_CLICK
|
||||
initial_instructions = [NavInsID.RIGHT_CLICK]
|
||||
# Skip 1st screen because 'Sign' is already present
|
||||
navigator.navigate(initial_instructions,
|
||||
screen_change_before_first_instruction=False,
|
||||
screen_change_after_last_instruction=False)
|
||||
else:
|
||||
next_action = NavInsID.USE_CASE_REVIEW_TAP
|
||||
confirm_action = NavInsID.USE_CASE_REVIEW_CONFIRM
|
||||
|
||||
navigator.navigate_until_text_and_compare(next_action,
|
||||
[confirm_action],
|
||||
"Sign",
|
||||
default_screenshot_path,
|
||||
test_name)
|
||||
scenario_navigator.review_approve(default_screenshot_path, test_name, "Sign")
|
||||
|
||||
# verify signature
|
||||
vrs = ResponseParser.signature(app_client.response().data)
|
||||
@@ -93,7 +60,7 @@ def test_personal_sign_non_ascii(firmware: Firmware,
|
||||
|
||||
def test_personal_sign_opensea(firmware: Firmware,
|
||||
backend: BackendInterface,
|
||||
navigator: Navigator,
|
||||
scenario_navigator: NavigateWithScenario,
|
||||
test_name: str,
|
||||
default_screenshot_path: Path):
|
||||
|
||||
@@ -108,23 +75,7 @@ def test_personal_sign_opensea(firmware: Firmware,
|
||||
if firmware.device == "nanos":
|
||||
pytest.skip("Not supported on LNS")
|
||||
with app_client.personal_sign(BIP32_PATH, msg.encode('utf-8')):
|
||||
if firmware.device.startswith("nano"):
|
||||
next_action = NavInsID.RIGHT_CLICK
|
||||
confirm_action = NavInsID.BOTH_CLICK
|
||||
initial_instructions = [NavInsID.RIGHT_CLICK]
|
||||
# Skip 1st screen because 'Sign' is already present
|
||||
navigator.navigate(initial_instructions,
|
||||
screen_change_before_first_instruction=False,
|
||||
screen_change_after_last_instruction=False)
|
||||
else:
|
||||
next_action = NavInsID.USE_CASE_REVIEW_TAP
|
||||
confirm_action = NavInsID.USE_CASE_REVIEW_CONFIRM
|
||||
|
||||
navigator.navigate_until_text_and_compare(next_action,
|
||||
[confirm_action],
|
||||
"Sign",
|
||||
default_screenshot_path,
|
||||
test_name)
|
||||
scenario_navigator.review_approve(default_screenshot_path, test_name, "Sign")
|
||||
|
||||
# verify signature
|
||||
vrs = ResponseParser.signature(app_client.response().data)
|
||||
@@ -134,7 +85,7 @@ def test_personal_sign_opensea(firmware: Firmware,
|
||||
|
||||
def test_personal_sign_reject(firmware: Firmware,
|
||||
backend: BackendInterface,
|
||||
navigator: Navigator,
|
||||
scenario_navigator: NavigateWithScenario,
|
||||
test_name: str,
|
||||
default_screenshot_path: Path):
|
||||
|
||||
@@ -145,21 +96,10 @@ def test_personal_sign_reject(firmware: Firmware,
|
||||
try:
|
||||
with app_client.personal_sign(BIP32_PATH, msg.encode('utf-8')):
|
||||
if firmware.device.startswith("nano"):
|
||||
next_action = NavInsID.RIGHT_CLICK
|
||||
confirm_action = NavInsID.BOTH_CLICK
|
||||
navigator.navigate_until_text_and_compare(next_action,
|
||||
[confirm_action],
|
||||
"Cancel",
|
||||
default_screenshot_path,
|
||||
test_name)
|
||||
end_text = "Cancel"
|
||||
else:
|
||||
# instructions = [NavInsID.USE_CASE_REVIEW_TAP]
|
||||
instructions = [NavInsID.USE_CASE_CHOICE_REJECT,
|
||||
NavInsID.USE_CASE_CHOICE_CONFIRM,
|
||||
NavInsID.USE_CASE_STATUS_DISMISS]
|
||||
navigator.navigate_and_compare(default_screenshot_path,
|
||||
test_name,
|
||||
instructions)
|
||||
end_text = "Sign"
|
||||
scenario_navigator.review_reject(default_screenshot_path, test_name, end_text)
|
||||
|
||||
except ExceptionRAPDU as e:
|
||||
assert e.status == StatusWord.CONDITION_NOT_SATISFIED
|
||||
|
||||