diff --git a/tests/integration/nano/conftest.py b/tests/integration/nano/conftest.py index 01a2d87a3..2e6248bd1 100644 --- a/tests/integration/nano/conftest.py +++ b/tests/integration/nano/conftest.py @@ -21,9 +21,11 @@ import pytest from ragger.firmware import Firmware +from ragger.navigator import NanoNavigator -from utils.app import TezosAppScreen, SpeculosTezosBackend, DEFAULT_SEED -from utils.backend import AppKind +from utils.account import Account, DEFAULT_ACCOUNT, DEFAULT_SEED +from utils.backend import TezosBackend, SpeculosTezosBackend +from utils.navigator import TezosNavigator FIRMWARES: List[Firmware] = [ Firmware.NANOS, @@ -151,13 +153,19 @@ def seed(request) -> str: param = getattr(request, "param", None) return param.get("seed", DEFAULT_SEED) if param else DEFAULT_SEED +@pytest.fixture(scope="function") +def account(request) -> Account: + """Get `account` for pytest.""" + param = getattr(request, "param", None) + return param.get("account", DEFAULT_ACCOUNT) if param else DEFAULT_ACCOUNT + @pytest.fixture(scope="function") def backend(app_path: Path, firmware: Firmware, port: int, display: bool, seed: str, - speculos_args: List[str]) -> Generator[SpeculosTezosBackend, None, None]: + speculos_args: List[str]) -> Generator[TezosBackend, None, None]: """Get `backend` for pytest.""" if display: @@ -177,9 +185,10 @@ def backend(app_path: Path, yield b @pytest.fixture(scope="function") -def app(backend: SpeculosTezosBackend, golden_run: bool) -> TezosAppScreen: - """Get `app` for pytest.""" - return TezosAppScreen(backend, AppKind.WALLET, golden_run) +def tezos_navigator(backend: TezosBackend, golden_run: bool) -> TezosNavigator: + """Get `navigator` for pytest.""" + navigator = NanoNavigator(backend, backend.firmware, golden_run) + return TezosNavigator(backend, navigator) @pytest.fixture(scope="function") def snapshot_dir(request) -> Path : diff --git a/tests/integration/nano/snapshots/nanos/home.png b/tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00000.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/home.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00000.png diff --git a/tests/integration/nano/snapshots/nanos/version.png b/tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00001.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/version.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00001.png diff --git a/tests/integration/nano/snapshots/nanos/settings.png b/tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00002.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/settings.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00002.png diff --git a/tests/integration/nano/snapshots/nanos/quit.png b/tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00003.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/quit.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_home_menu/00003.png diff --git a/tests/integration/nano/snapshots/nanos/settings_expert_mode_disabled.png b/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00000.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/settings_expert_mode_disabled.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00000.png diff --git a/tests/integration/nano/snapshots/nanos/settings_blindsign_off.png b/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00001.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/settings_blindsign_off.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00001.png diff --git a/tests/integration/nano/snapshots/nanos/back.png b/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00002.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/back.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00002.png diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00003.png b/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00003.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_settings_menu/00003.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00000.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00000.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00000.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00001.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00001.png new file mode 100644 index 000000000..c52c35326 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00001.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00002.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00002.png new file mode 100644 index 000000000..34cf547a2 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00002.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00003.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00003.png new file mode 100644 index 000000000..a10bdaeac Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00003.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00004.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00004.png new file mode 100644 index 000000000..834142cf8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00004.png differ diff --git a/tests/integration/nano/snapshots/nanos/settings_blindsign_on.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00005.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/settings_blindsign_on.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00005.png diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00006.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00006.png new file mode 100644 index 000000000..b5c1b1cbe Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00006.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00007.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00007.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00007.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00008.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00008.png new file mode 100644 index 000000000..c52c35326 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00008.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00009.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00009.png new file mode 100644 index 000000000..34cf547a2 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00010.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00010.png new file mode 100644 index 000000000..a10bdaeac Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00011.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00011.png new file mode 100644 index 000000000..1e5bfd2a1 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00011.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00012.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00012.png new file mode 100644 index 000000000..834142cf8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00012.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00013.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00013.png new file mode 100644 index 000000000..b5c1b1cbe Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00013.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00014.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00014.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_blindsign/00014.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00000.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00000.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00000.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00001.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00001.png new file mode 100644 index 000000000..c52c35326 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00001.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00002.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00002.png new file mode 100644 index 000000000..34cf547a2 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00002.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00003.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00003.png new file mode 100644 index 000000000..a10bdaeac Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00003.png differ diff --git a/tests/integration/nano/snapshots/nanos/settings_expert_mode_enabled.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00004.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/settings_expert_mode_enabled.png rename to tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00004.png diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00005.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00005.png new file mode 100644 index 000000000..834142cf8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00005.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00006.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00006.png new file mode 100644 index 000000000..b5c1b1cbe Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00006.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00007.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00007.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00007.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00008.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00008.png new file mode 100644 index 000000000..c52c35326 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00008.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00009.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00009.png new file mode 100644 index 000000000..34cf547a2 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00010.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00010.png new file mode 100644 index 000000000..1b968b6c2 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00011.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00011.png new file mode 100644 index 000000000..a10bdaeac Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00011.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00012.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00012.png new file mode 100644 index 000000000..834142cf8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00012.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00013.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00013.png new file mode 100644 index 000000000..b5c1b1cbe Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00013.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00014.png b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00014.png new file mode 100644 index 000000000..056ffc401 Binary files /dev/null and b/tests/integration/nano/snapshots/nanos/test_menu/test_toggle_expert_mode/00014.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png deleted file mode 100644 index e267ed3c3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png deleted file mode 100644 index 56f3e2e49..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00003.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png deleted file mode 100644 index e033929ec..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png deleted file mode 100644 index 138c4f0ab..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png deleted file mode 100644 index 3884b27e5..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png deleted file mode 100644 index e8d3e1fc0..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png deleted file mode 100644 index a51a5f9f6..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png deleted file mode 100644 index 18f76751c..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png deleted file mode 100644 index e725e1f9e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png deleted file mode 100644 index 1c5ab6154..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png deleted file mode 100644 index c40c89919..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png deleted file mode 100644 index 92b4bce4e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00011.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00011.png deleted file mode 100644 index 6f75a6599..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00011.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00012.png b/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00012.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_apdu_sign/test_sign_with_small_packet/00012.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png deleted file mode 100644 index e267ed3c3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png deleted file mode 100644 index 56f3e2e49..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00003.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png deleted file mode 100644 index e267ed3c3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png deleted file mode 100644 index 56f3e2e49..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00003.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[ED25519]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png deleted file mode 100644 index e267ed3c3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png deleted file mode 100644 index 56f3e2e49..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00003.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png deleted file mode 100644 index e267ed3c3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png deleted file mode 100644 index 56f3e2e49..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00003.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png deleted file mode 100644 index e033929ec..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png deleted file mode 100644 index 138c4f0ab..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png deleted file mode 100644 index 3884b27e5..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png deleted file mode 100644 index e8d3e1fc0..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png deleted file mode 100644 index a51a5f9f6..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png deleted file mode 100644 index 18f76751c..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png deleted file mode 100644 index e725e1f9e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png deleted file mode 100644 index 1c5ab6154..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png deleted file mode 100644 index c40c89919..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png deleted file mode 100644 index 92b4bce4e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00011.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00011.png deleted file mode 100644 index 6f75a6599..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00011.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00012.png b/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00012.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_sign/test_key/test_sign_with_another_seed[seed21]/00012.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png deleted file mode 100644 index f78f8b283..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png deleted file mode 100644 index 597d5b6cd..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png deleted file mode 100644 index 6393b1ad2..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png deleted file mode 100644 index 593cef04a..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00004.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00004.png deleted file mode 100644 index 970b15944..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png deleted file mode 100644 index 053fc534b..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png deleted file mode 100644 index e033929ec..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png deleted file mode 100644 index 8b7980241..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png deleted file mode 100644 index 97eab5d99..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png deleted file mode 100644 index 9126afa34..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png deleted file mode 100644 index 78b15b726..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png deleted file mode 100644 index 1e80339bd..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png deleted file mode 100644 index e725e1f9e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png deleted file mode 100644 index 1c5ab6154..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png deleted file mode 100644 index d58a3edc0..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png deleted file mode 100644 index 92b4bce4e..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png deleted file mode 100644 index de32f3ce0..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png deleted file mode 100644 index d1f0c52d8..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png deleted file mode 100644 index 9068ab50d..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png deleted file mode 100644 index ca3d99817..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png deleted file mode 100644 index caae0be86..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00016.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00016.png deleted file mode 100644 index 53b2eab90..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00016.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00017.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00017.png deleted file mode 100644 index f20965b93..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00017.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00018.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00018.png deleted file mode 100644 index 91ba67e9d..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00018.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00019.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00019.png deleted file mode 100644 index e2e233f01..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00019.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00020.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00020.png deleted file mode 100644 index 972f178b3..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00020.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00021.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00021.png deleted file mode 100644 index 083033d45..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00021.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00022.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00022.png deleted file mode 100644 index 9c2054a60..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00022.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00023.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00023.png deleted file mode 100644 index 08b20a837..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00023.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00024.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00024.png deleted file mode 100644 index afa9173a2..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00024.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00025.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00025.png deleted file mode 100644 index 7226a9e23..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00025.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00026.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00026.png deleted file mode 100644 index dc7f9b18a..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00026.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00027.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00027.png deleted file mode 100644 index 182640db4..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00027.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00028.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00028.png deleted file mode 100644 index f13eb25ed..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00028.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00029.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00029.png deleted file mode 100644 index 37c456b81..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00029.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00030.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00030.png deleted file mode 100644 index 873a1b0ad..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00030.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00031.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00031.png deleted file mode 100644 index 7e0e23820..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00031.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00032.png b/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00032.png deleted file mode 100644 index 970b15944..000000000 Binary files a/tests/integration/nano/snapshots/nanos/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00032.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/home.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00000.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/home.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00000.png diff --git a/tests/integration/nano/snapshots/nanosp/version.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00001.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/version.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00001.png diff --git a/tests/integration/nano/snapshots/nanosp/settings.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00002.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/settings.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00002.png diff --git a/tests/integration/nano/snapshots/nanosp/quit.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00003.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/quit.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_home_menu/00003.png diff --git a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00000.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00000.png diff --git a/tests/integration/nano/snapshots/nanosp/settings_blindsign_off.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00001.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/settings_blindsign_off.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00001.png diff --git a/tests/integration/nano/snapshots/nanosp/back.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00002.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/back.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00002.png diff --git a/tests/integration/nano/snapshots/nanox/home.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00003.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/home.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_settings_menu/00003.png diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00000.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00000.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/version.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00001.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/version.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00001.png diff --git a/tests/integration/nano/snapshots/nanox/settings.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00002.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/settings.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00002.png diff --git a/tests/integration/nano/snapshots/nanox/settings_expert_mode_disabled.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00003.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/settings_expert_mode_disabled.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00003.png diff --git a/tests/integration/nano/snapshots/nanox/settings_blindsign_off.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00004.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/settings_blindsign_off.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00004.png diff --git a/tests/integration/nano/snapshots/nanosp/settings_blindsign_on.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00005.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/settings_blindsign_on.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00005.png diff --git a/tests/integration/nano/snapshots/nanox/back.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00006.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/back.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00006.png diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00007.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00007.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00008.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00008.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00009.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00009.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00010.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00010.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00010.png differ diff --git a/tests/integration/nano/snapshots/nanox/settings_blindsign_on.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00011.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/settings_blindsign_on.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00011.png diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00012.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00012.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00012.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00013.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00013.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00013.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00014.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00014.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_blindsign/00014.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00000.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00000.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00000.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00001.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00001.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00002.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00002.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00003.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00003.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00004.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00004.png diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00005.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00005.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00006.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00006.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00007.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00007.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00008.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00008.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00009.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00009.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00009.png differ diff --git a/tests/integration/nano/snapshots/nanox/settings_expert_mode_enabled.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00010.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/settings_expert_mode_enabled.png rename to tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00010.png diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00011.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00011.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00012.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00012.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00012.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00013.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00013.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00013.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00014.png b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00014.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanosp/test_menu/test_toggle_expert_mode/00014.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00001.png deleted file mode 100644 index 3c46f158c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00002.png deleted file mode 100644 index 986f7dda9..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00003.png deleted file mode 100644 index df5a094dd..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00004.png deleted file mode 100644 index c7b3007d2..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00005.png deleted file mode 100644 index 7aadda9bf..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00006.png deleted file mode 100644 index 8a571ec0c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00007.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_nanosp_regression_press_right_works_across_apdu_recieves/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png deleted file mode 100644 index 86f889eb1..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png deleted file mode 100644 index e7bfe032f..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png deleted file mode 100644 index 04889b556..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png deleted file mode 100644 index c5894b08c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png deleted file mode 100644 index 364af7467..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png deleted file mode 100644 index c3d918032..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png deleted file mode 100644 index 86f889eb1..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png deleted file mode 100644 index e7bfe032f..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png deleted file mode 100644 index 04889b556..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png deleted file mode 100644 index c5894b08c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png deleted file mode 100644 index 364af7467..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png deleted file mode 100644 index c3d918032..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png b/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png deleted file mode 100644 index 17a084dd1..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png deleted file mode 100644 index 53efaa94b..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png deleted file mode 100644 index 189d656f1..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png deleted file mode 100644 index 3d36b194c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png deleted file mode 100644 index c0ac1f93d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png deleted file mode 100644 index af9beddbf..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png deleted file mode 100644 index 908600200..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png deleted file mode 100644 index ca0128108..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png deleted file mode 100644 index 2b33e84bd..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png deleted file mode 100644 index 431986c71..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png deleted file mode 100644 index 1acb7d563..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png deleted file mode 100644 index eb0513902..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png deleted file mode 100644 index 85edb568e..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png deleted file mode 100644 index 8b3b3b148..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png b/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png deleted file mode 100644 index 3d36b194c..000000000 Binary files a/tests/integration/nano/snapshots/nanosp/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00000.png b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00000.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00001.png b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00001.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00002.png b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00002.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/quit.png b/tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00003.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/quit.png rename to tests/integration/nano/snapshots/nanox/test_menu/test_home_menu/00003.png diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00000.png b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00000.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00001.png b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00001.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00002.png b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00002.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00003.png b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00003.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_settings_menu/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00000.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00000.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00001.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00001.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00002.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00002.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00003.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00003.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00004.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00004.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00005.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00005.png new file mode 100644 index 000000000..94d6d85b3 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00006.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00006.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00006.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00007.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00007.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00008.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00008.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00009.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00009.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00009.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00010.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00010.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00010.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00011.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00011.png new file mode 100644 index 000000000..94d6d85b3 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00011.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00012.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00012.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00012.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00013.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00013.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00013.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00014.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00014.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_blindsign/00014.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00000.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00000.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00001.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00001.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00002.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00002.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00003.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00003.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00004.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00004.png new file mode 100644 index 000000000..f7e9acdbd Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00005.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00005.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00006.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00006.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00006.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00007.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00007.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00008.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00008.png new file mode 100644 index 000000000..e0fecb764 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00009.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00009.png new file mode 100644 index 000000000..d885fe67b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00009.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00010.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00010.png new file mode 100644 index 000000000..f7e9acdbd Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00010.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00011.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00011.png new file mode 100644 index 000000000..22d3f5c2e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00011.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00012.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00012.png new file mode 100644 index 000000000..3ea6ff33a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00012.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00013.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00013.png new file mode 100644 index 000000000..e06738f46 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00013.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00014.png b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00014.png new file mode 100644 index 000000000..08e112b5b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_menu/test_toggle_expert_mode/00014.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_micheline_without_hash/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png deleted file mode 100644 index 86f889eb1..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png deleted file mode 100644 index e7bfe032f..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png deleted file mode 100644 index 04889b556..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png deleted file mode 100644 index c5894b08c..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png deleted file mode 100644 index 364af7467..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png deleted file mode 100644 index c3d918032..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png b/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_apdu_sign/test_sign_with_small_packet/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[BIP32_ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[ED25519]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256K1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png deleted file mode 100644 index b0dbfe2af..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_micheline_basic[SECP256R1]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png deleted file mode 100644 index 86f889eb1..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png deleted file mode 100644 index e7bfe032f..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png deleted file mode 100644 index 04889b556..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png deleted file mode 100644 index c5894b08c..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png deleted file mode 100644 index 364af7467..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png deleted file mode 100644 index c3d918032..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png b/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_sign/test_key/test_sign_with_another_seed[seed21]/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png deleted file mode 100644 index 17a084dd1..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png deleted file mode 100644 index 53efaa94b..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png deleted file mode 100644 index 189d656f1..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png deleted file mode 100644 index 3d36b194c..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_public_key/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png deleted file mode 100644 index 9fa51df29..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00000.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png deleted file mode 100644 index 7009edb4d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00001.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png deleted file mode 100644 index c0ac1f93d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00002.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png deleted file mode 100644 index af9beddbf..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00003.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png deleted file mode 100644 index 908600200..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00004.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png deleted file mode 100644 index ca0128108..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00005.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png deleted file mode 100644 index ac0607630..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00006.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png deleted file mode 100644 index 2b33e84bd..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00007.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png deleted file mode 100644 index 1fcdee14d..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00008.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png deleted file mode 100644 index 431986c71..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00009.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png deleted file mode 100644 index 1acb7d563..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00010.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png deleted file mode 100644 index eb0513902..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00011.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png deleted file mode 100644 index 85edb568e..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00012.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png deleted file mode 100644 index 8b3b3b148..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00013.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png deleted file mode 100644 index 471324463..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00014.png and /dev/null differ diff --git a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png b/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png deleted file mode 100644 index 3d36b194c..000000000 Binary files a/tests/integration/nano/snapshots/nanox/test_wrong_apdu/test_regression_continue_after_reject/reject_signing/00015.png and /dev/null differ diff --git a/tests/integration/nano/test_menu.py b/tests/integration/nano/test_menu.py index 722e04e3b..d29e0ca65 100755 --- a/tests/integration/nano/test_menu.py +++ b/tests/integration/nano/test_menu.py @@ -16,68 +16,67 @@ """Gathering of tests related to app menu.""" -from utils.app import Screen, TezosAppScreen - -def test_menu(app: TezosAppScreen): - """Check main menu flow""" - app.assert_screen(Screen.HOME) - app.backend.right_click() - app.assert_screen(Screen.VERSION) - app.backend.both_click() - app.assert_screen(Screen.VERSION) - app.backend.right_click() - app.assert_screen(Screen.SETTINGS) - app.backend.right_click() - app.assert_screen(Screen.QUIT) - app.backend.left_click() - app.assert_screen(Screen.SETTINGS) - app.backend.left_click() - app.assert_screen(Screen.VERSION) - app.backend.left_click() - app.assert_screen(Screen.HOME) - app.backend.both_click() - app.assert_screen(Screen.HOME) - app.backend.left_click() - app.assert_screen(Screen.QUIT) - app.backend.right_click() - app.assert_screen(Screen.HOME) - app.backend.right_click() - app.assert_screen(Screen.VERSION) - app.backend.right_click() - app.assert_screen(Screen.SETTINGS) - app.backend.right_click() - app.assert_screen(Screen.QUIT) - app.backend.right_click() - app.assert_screen(Screen.HOME) - app.backend.right_click() - app.assert_screen(Screen.VERSION) - - # Check Settings menu operation - app.backend.right_click() - app.assert_screen(Screen.SETTINGS) - app.backend.both_click() - app.assert_screen(Screen.SETTINGS_EXPERT_MODE_DISABLED) - app.backend.both_click() - app.assert_screen(Screen.SETTINGS_EXPERT_MODE_ENABLED) - app.backend.right_click() - app.assert_screen(Screen.SETTINGS_BLINDSIGN_OFF) - app.backend.both_click() - app.assert_screen(Screen.SETTINGS_BLINDSIGN_ON) - app.backend.both_click() - app.assert_screen(Screen.SETTINGS_BLINDSIGN_OFF) - app.backend.right_click() - app.assert_screen(Screen.SETTINGS_BACK) - app.backend.left_click() - app.assert_screen(Screen.SETTINGS_BLINDSIGN_OFF) - app.backend.left_click() - app.assert_screen(Screen.SETTINGS_EXPERT_MODE_ENABLED) - app.backend.left_click() - app.assert_screen(Screen.SETTINGS_BACK) - app.backend.right_click() - app.assert_screen(Screen.SETTINGS_EXPERT_MODE_ENABLED) - app.backend.left_click() - app.assert_screen(Screen.SETTINGS_BACK) - app.backend.both_click() - app.assert_screen(Screen.HOME) - app.backend.left_click() - app._quit() +from pathlib import Path +from typing import List, Union + +import requests + +from ragger.navigator import NavIns, NavInsID + +from utils.backend import TezosBackend +from utils.navigator import TezosNavigator + + +def test_home_menu(tezos_navigator: TezosNavigator, snapshot_dir: Path): + """Check home menu flow""" + instructions: List[Union[NavIns, NavInsID]] = [ + # Home + NavInsID.RIGHT_CLICK, # Version + NavInsID.RIGHT_CLICK, # Settings + NavInsID.RIGHT_CLICK, # Quit + ] + tezos_navigator.navigate( + instructions=instructions, + snap_path=snapshot_dir, + ) + + +def test_settings_menu(tezos_navigator: TezosNavigator, snapshot_dir: Path): + """Check settings menu flow""" + tezos_navigator.navigate_to_settings() + instructions: List[Union[NavIns, NavInsID]] = [ + # Expert Mode + NavInsID.RIGHT_CLICK, # Blind Sign + NavInsID.RIGHT_CLICK, # Back + NavInsID.BOTH_CLICK, # Home + ] + tezos_navigator.navigate( + instructions=instructions, + snap_path=snapshot_dir + ) + + +def test_toggle_expert_mode(tezos_navigator: TezosNavigator, snapshot_dir: Path): + """Check settings' expert_mode toggle""" + snap_idx = tezos_navigator.toggle_expert_mode(snap_path=snapshot_dir) + # Toggle back + tezos_navigator.toggle_expert_mode(snap_start_idx=snap_idx, snap_path=snapshot_dir) + + +def test_toggle_blindsign(tezos_navigator: TezosNavigator, snapshot_dir: Path): + """Check settings' blindsign toggle""" + snap_idx = tezos_navigator.toggle_blindsign(snap_path=snapshot_dir) + # Toggle back + tezos_navigator.toggle_blindsign(snap_start_idx=snap_idx, snap_path=snapshot_dir) + + +def test_quit(backend: TezosBackend): + """Check quit app""" + # Home + backend.left_click() + backend.wait_for_screen_change() # Quit + try: + backend.both_click() + assert False, "Must have lost connection with speculos" + except requests.exceptions.ConnectionError: + pass diff --git a/tests/integration/nano/test_public_key.py b/tests/integration/nano/test_public_key.py index f3d9969c0..59215aa48 100644 --- a/tests/integration/nano/test_public_key.py +++ b/tests/integration/nano/test_public_key.py @@ -20,8 +20,9 @@ import pytest -from utils.account import Account, SigType -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account, PublicKey, SigType +from utils.backend import TezosBackend, StatusCode +from utils.navigator import TezosNavigator accounts = [ Account("m/44'/1729'/0'/0'", @@ -39,34 +40,35 @@ ] @pytest.mark.parametrize("account", accounts, ids=lambda account: f"{account.sig_type}") -def test_get_pk(app: TezosAppScreen, account: Account): +def test_get_pk(backend: TezosBackend, account: Account): """Test that public keys get from the app are correct.""" - app.assert_screen(Screen.HOME) + expected_public_key = account.key.public_key() - data = app.backend.get_public_key(account, with_prompt=False) + data = backend.get_public_key(account, with_prompt=False) - app.checker.check_public_key(account, data) + public_key = PublicKey.from_bytes(data, account.sig_type) + + assert public_key == expected_public_key.encode(), \ + f"Expected public key {expected_public_key} but got {public_key}" - app.quit() @pytest.mark.parametrize("account", accounts, ids=lambda account: f"{account.sig_type}") -def test_provide_pk(app: TezosAppScreen, account: Account, snapshot_dir: Path): +def test_provide_pk(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Test that public keys get from the app are correct and correctly displayed.""" - app.assert_screen(Screen.HOME) - - data = app.provide_public_key(account, snapshot_dir) + expected_public_key = account.key.public_key() - app.checker.check_public_key(account, data) + data = tezos_navigator.provide_public_key(account, snap_path=snapshot_dir) - app.quit() + public_key = PublicKey.from_bytes(data, account.sig_type) -def test_reject_pk(app: TezosAppScreen, snapshot_dir: Path): - """Check reject pk behaviour""" + assert public_key == expected_public_key.encode(), \ + f"Expected public key {expected_public_key} but got {public_key}" - app.assert_screen(Screen.HOME) - app.reject_public_key(DEFAULT_ACCOUNT, snapshot_dir) +def test_reject_pk(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check reject pk behaviour""" - app.quit() + with StatusCode.REJECT.expected(): + tezos_navigator.reject_public_key(account, snap_path=snapshot_dir) diff --git a/tests/integration/nano/test_sign/operations/test_sign_ballot.py b/tests/integration/nano/test_sign/operations/test_sign_ballot.py index 68f09811b..3ddeafb65 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_ballot.py +++ b/tests/integration/nano/test_sign/operations/test_sign_ballot.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import Ballot +from utils.navigator import TezosNavigator -def test_sign_ballot(app: TezosAppScreen, snapshot_dir: Path): - """Check signing ballot""" - app.assert_screen(Screen.HOME) +def test_sign_ballot(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing ballot""" message = Ballot( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -33,15 +33,14 @@ def test_sign_ballot(app: TezosAppScreen, snapshot_dir: Path): period = 32 ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_batched_operations.py b/tests/integration/nano/test_sign/operations/test_sign_batched_operations.py index d46266eeb..f3665a36a 100644 --- a/tests/integration/nano/test_sign/operations/test_sign_batched_operations.py +++ b/tests/integration/nano/test_sign/operations/test_sign_batched_operations.py @@ -20,19 +20,21 @@ from conftest import requires_device -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import ( OperationGroup, Origination, Transaction, TransferTicket ) +from utils.navigator import TezosNavigator + @requires_device("nanos") -def test_nanos_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path): +def test_nanos_regression_batched_ops(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing batch operation""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = OperationGroup([ Transaction( @@ -57,24 +59,23 @@ def test_nanos_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path): ) ]) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - @requires_device("nanox") -def test_nanox_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path): +def test_nanox_regression_batched_ops(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing batch operation""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = OperationGroup([ Transaction( @@ -99,24 +100,22 @@ def test_nanox_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path): ) ]) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_sign_complex_operation(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_complex_operation(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing complex operation""" - app.assert_screen(Screen.HOME) - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = OperationGroup([ Origination( @@ -143,15 +142,14 @@ def test_sign_complex_operation(app: TezosAppScreen, snapshot_dir: Path): ) ]) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_delegation.py b/tests/integration/nano/test_sign/operations/test_sign_delegation.py index f69febe24..c91749d6e 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_delegation.py +++ b/tests/integration/nano/test_sign/operations/test_sign_delegation.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import Delegation +from utils.navigator import TezosNavigator -def test_sign_delegation(app: TezosAppScreen, snapshot_dir: Path): - """Check signing delegation""" - app.assert_screen(Screen.HOME) +def test_sign_delegation(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing delegation""" message = Delegation( source = 'tz2KC42yW9FXFMJpkUooae2NFYQsM5do3E8H', @@ -35,15 +35,14 @@ def test_sign_delegation(app: TezosAppScreen, snapshot_dir: Path): delegate = 'tz1TmFPVZsGQ8MnrBJtnECJgkFUwLa6EWYDm' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_failing_noop.py b/tests/integration/nano/test_sign/operations/test_sign_failing_noop.py index 648462e81..86b358050 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_failing_noop.py +++ b/tests/integration/nano/test_sign/operations/test_sign_failing_noop.py @@ -18,25 +18,24 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import FailingNoop +from utils.navigator import TezosNavigator -def test_sign_failing_noop(app: TezosAppScreen, snapshot_dir: Path): - """Check signing failing noop""" - app.assert_screen(Screen.HOME) +def test_sign_failing_noop(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing failing noop""" message = FailingNoop("9f09f2952d34528c733f94615cfc39bc555619fc550dd4a67ba2208ce8e867aa3d13a6ef99dfbe32c6974aa9a2150d21eca29c3349e59c13b9081f1c11b440ac4d3455dedbe4ee0de15a8af620d4c86247d9d132de1bb6da23d5ff9d8dffda22ba9a84") - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_increase_paid_storage.py b/tests/integration/nano/test_sign/operations/test_sign_increase_paid_storage.py index 9b0e0266c..e7b3dd7ea 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_increase_paid_storage.py +++ b/tests/integration/nano/test_sign/operations/test_sign_increase_paid_storage.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import IncreasePaidStorage +from utils.navigator import TezosNavigator -def test_sign_increase_paid_storage(app: TezosAppScreen, snapshot_dir: Path): - """Check signing increase paid storage""" - app.assert_screen(Screen.HOME) +def test_sign_increase_paid_storage(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing increase paid storage""" message = IncreasePaidStorage( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -36,15 +36,14 @@ def test_sign_increase_paid_storage(app: TezosAppScreen, snapshot_dir: Path): destination = "KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT" ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_origination.py b/tests/integration/nano/test_sign/operations/test_sign_origination.py index 05c8acc30..5c167483f 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_origination.py +++ b/tests/integration/nano/test_sign/operations/test_sign_origination.py @@ -18,13 +18,15 @@ from pathlib import Path -from utils.app import TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import Origination +from utils.navigator import TezosNavigator -def test_sign_origination(app: TezosAppScreen, snapshot_dir: Path): + +def test_sign_origination(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing origination""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Origination( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -37,15 +39,14 @@ def test_sign_origination(app: TezosAppScreen, snapshot_dir: Path): balance = 500000 ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_proposals.py b/tests/integration/nano/test_sign/operations/test_sign_proposals.py index 92c4710d5..556a3f6fe 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_proposals.py +++ b/tests/integration/nano/test_sign/operations/test_sign_proposals.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import Proposals +from utils.navigator import TezosNavigator -def test_sign_proposals(app: TezosAppScreen, snapshot_dir: Path): - """Check signing proposals""" - app.assert_screen(Screen.HOME) +def test_sign_proposals(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing proposals""" message = Proposals( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -35,15 +35,14 @@ def test_sign_proposals(app: TezosAppScreen, snapshot_dir: Path): period = 32 ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_register_global_constant.py b/tests/integration/nano/test_sign/operations/test_sign_register_global_constant.py index 70a6d3fa5..9b5fc069b 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_register_global_constant.py +++ b/tests/integration/nano/test_sign/operations/test_sign_register_global_constant.py @@ -18,13 +18,15 @@ from pathlib import Path -from utils.app import TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import RegisterGlobalConstant +from utils.navigator import TezosNavigator -def test_sign_register_global_constant(app: TezosAppScreen, snapshot_dir: Path): + +def test_sign_register_global_constant(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing register global constant""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = RegisterGlobalConstant( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -35,15 +37,14 @@ def test_sign_register_global_constant(app: TezosAppScreen, snapshot_dir: Path): value = {'prim': 'Pair', 'args': [{'string': '1'}, {'int': 2}]} ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_reveal.py b/tests/integration/nano/test_sign/operations/test_sign_reveal.py index 41f899073..485f1c335 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_reveal.py +++ b/tests/integration/nano/test_sign/operations/test_sign_reveal.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import Reveal +from utils.navigator import TezosNavigator -def test_sign_reveal(app: TezosAppScreen, snapshot_dir: Path): - """Check signing reveal""" - app.assert_screen(Screen.HOME) +def test_sign_reveal(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing reveal""" message = Reveal( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -35,15 +35,14 @@ def test_sign_reveal(app: TezosAppScreen, snapshot_dir: Path): public_key = 'edpkuXX2VdkdXzkN11oLCb8Aurdo1BTAtQiK8ZY9UPj2YMt3AHEpcY' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_add_messages.py b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_add_messages.py index 00712038a..230af2121 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_add_messages.py +++ b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_add_messages.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import ScRollupAddMessage +from utils.navigator import TezosNavigator -def test_sign_sc_rollup_add_messages(app: TezosAppScreen, snapshot_dir: Path): - """Check signing smart rollup add message""" - app.assert_screen(Screen.HOME) +def test_sign_sc_rollup_add_messages(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing smart rollup add message""" message = ScRollupAddMessage( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -35,15 +35,14 @@ def test_sign_sc_rollup_add_messages(app: TezosAppScreen, snapshot_dir: Path): message = [bytes.fromhex('012345'), bytes.fromhex('67'), bytes.fromhex('89abcdef')] ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_execute_outbox_message.py b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_execute_outbox_message.py index c28fa0789..c67918903 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_execute_outbox_message.py +++ b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_execute_outbox_message.py @@ -18,13 +18,15 @@ from pathlib import Path -from utils.app import TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import ScRollupExecuteOutboxMessage +from utils.navigator import TezosNavigator -def test_sign_sc_rollup_execute_outbox_message(app: TezosAppScreen, snapshot_dir: Path): + +def test_sign_sc_rollup_execute_outbox_message(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing smart rollup execute outbox message""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = ScRollupExecuteOutboxMessage( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -37,15 +39,14 @@ def test_sign_sc_rollup_execute_outbox_message(app: TezosAppScreen, snapshot_dir output_proof = b'9f09f2952d34528c733f94615cfc39bc555619fc550dd4a67ba2208ce8e867aa3d13a6ef99dfbe32c6974aa9a2150d21eca29c3349e59c13b9081f1c11b440ac4d3455dedbe4ee0de15a8af620d4c86247d9d132de1bb6da23d5ff9d8dffda22ba9a84' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_originate.py b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_originate.py index f0196912a..00829ae8f 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_originate.py +++ b/tests/integration/nano/test_sign/operations/test_sign_sc_rollup_originate.py @@ -21,8 +21,9 @@ import pytest -from utils.app import TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import ScRollupOriginate +from utils.navigator import TezosNavigator @pytest.mark.parametrize( @@ -41,10 +42,10 @@ "with_whitelist", ], ) -def test_sign_sc_rollup_originate(app: TezosAppScreen, whitelist: Optional[List[str]], snapshot_dir: Path): +def test_sign_sc_rollup_originate(tezos_navigator: TezosNavigator, account: Account, whitelist: Optional[List[str]], snapshot_dir: Path): """Check signing smart rollup originate""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = ScRollupOriginate( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -58,15 +59,14 @@ def test_sign_sc_rollup_originate(app: TezosAppScreen, whitelist: Optional[List[ whitelist = whitelist ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_set_consensus_key.py b/tests/integration/nano/test_sign/operations/test_sign_set_consensus_key.py index 232cc5cd7..38cc77024 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_set_consensus_key.py +++ b/tests/integration/nano/test_sign/operations/test_sign_set_consensus_key.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import UpdateConsensusKey +from utils.navigator import TezosNavigator -def test_sign_set_consensus_key(app: TezosAppScreen, snapshot_dir: Path): - """Check signing set consensus key""" - app.assert_screen(Screen.HOME) +def test_sign_set_consensus_key(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing set consensus key""" message = UpdateConsensusKey( source = 'tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E', @@ -35,15 +35,14 @@ def test_sign_set_consensus_key(app: TezosAppScreen, snapshot_dir: Path): pk = "edpkuXX2VdkdXzkN11oLCb8Aurdo1BTAtQiK8ZY9UPj2YMt3AHEpcY" ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_set_deposit_limit.py b/tests/integration/nano/test_sign/operations/test_sign_set_deposit_limit.py index bd8ae82b5..3bbe4c06f 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_set_deposit_limit.py +++ b/tests/integration/nano/test_sign/operations/test_sign_set_deposit_limit.py @@ -18,13 +18,13 @@ from pathlib import Path -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import SetDepositLimit +from utils.navigator import TezosNavigator -def test_sign_set_deposit_limit(app: TezosAppScreen, snapshot_dir: Path): - """Check signing set deposit limit""" - app.assert_screen(Screen.HOME) +def test_sign_set_deposit_limit(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): + """Check signing set deposit limit""" message = SetDepositLimit( source = 'tz3XeTwXXJeWNgVR3LqMcyBDdnxjbZ7TeEGH', @@ -35,15 +35,14 @@ def test_sign_set_deposit_limit(app: TezosAppScreen, snapshot_dir: Path): limit = 20000 ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_transaction.py b/tests/integration/nano/test_sign/operations/test_sign_transaction.py index ef038f3ef..50540dd29 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_transaction.py +++ b/tests/integration/nano/test_sign/operations/test_sign_transaction.py @@ -18,14 +18,16 @@ from pathlib import Path -from utils.app import Screen, ScreenText, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.backend import StatusCode from utils.message import Transaction +from utils.navigator import ScreenText, TezosNavigator -def test_sign_transaction(app: TezosAppScreen, snapshot_dir: Path): + +def test_sign_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing transaction""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu', @@ -39,23 +41,22 @@ def test_sign_transaction(app: TezosAppScreen, snapshot_dir: Path): parameter = {'prim': 'CAR'} ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_reject_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_reject_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check reject transaction""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -69,17 +70,18 @@ def test_reject_transaction(app: TezosAppScreen, snapshot_dir: Path): parameter = [{'prim':'pair','args':[{'string':"["},{'prim':'pair','args':[{'string':"Z"},{'prim':'pair','args':[{'string':"Y"},{'prim':'pair','args':[{'string':"X"},{'prim':'pair','args':[{'string':"W"},{'prim':'pair','args':[{'string':"V"},{'prim':'pair','args':[{'string':"U"},{'prim':'pair','args':[{'string':"T"},{'prim':'pair','args':[{'string':"S"},{'prim':'pair','args':[{'string':"R"},{'prim':'pair','args':[{'string':"Q"},{'prim':'pair','args':[{'string':"P"},{'prim':'pair','args':[{'string':"O"},{'prim':'pair','args':[{'string':"N"},{'prim':'pair','args':[{'string':"M"},{'prim':'pair','args':[{'string':"L"},{'prim':'pair','args':[{'string':"K"},{'prim':'pair','args':[{'string':"J"},{'prim':'pair','args':[{'string':"I"},{'prim':'pair','args':[{'string':"H"},{'prim':'pair','args':[{'string':"G"},{'prim':'pair','args':[{'string':"F"},{'prim':'pair','args':[{'string':"E"},{'prim':'pair','args':[{'string':"D"},{'prim':'pair','args':[{'string':"C"},{'prim':'pair','args':[{'string':"B"},[]]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]},{'prim':'pair','args':[{'int':10},{'prim':'pair','args':[{'int':9},{'prim':'pair','args':[{'int':8},{'prim':'pair','args':[{'int':7},{'prim':'pair','args':[{'int':6},{'prim':'pair','args':[{'int':5},{'prim':'pair','args':[{'int':4},{'prim':'pair','args':[{'int':3},{'prim':'pair','args':[{'int':2},{'prim':'pair','args':[{'int':1},[]]}]}]}]}]}]}]}]}]}]}] ) - app.reject_signing(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + with StatusCode.REJECT.expected(): + tezos_navigator.reject_signing( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.quit() - -def test_sign_simple_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_simple_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign not complex transaction""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -91,24 +93,21 @@ def test_sign_simple_transaction(app: TezosAppScreen, snapshot_dir: Path): amount = 10000 ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_too_complex_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_too_complex_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign complex transaction""" - app.assert_screen(Screen.HOME) - message = Transaction( source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu', fee = 50000, @@ -121,20 +120,18 @@ def test_too_complex_transaction(app: TezosAppScreen, snapshot_dir: Path): parameter = {'prim': 'CAR'} ) - app._failing_signing(DEFAULT_ACCOUNT, - message, - with_hash=True, - navigate=(lambda: app.navigate_until_text( - ScreenText.BACK_HOME, - snapshot_dir)), - status_code=StatusCode.REJECT) + with StatusCode.REJECT.expected(): + tezos_navigator.sign( + account, + message, + with_hash=True, + navigate=lambda: tezos_navigator.navigate_review(text=ScreenText.BACK_HOME, snap_path=snapshot_dir) + ) - app.quit() - -def test_sign_stake_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_stake_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign stake""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz2WmivuMG8MMRKMEmzKRMMxMApxZQWYNS4W', @@ -147,23 +144,22 @@ def test_sign_stake_transaction(app: TezosAppScreen, snapshot_dir: Path): entrypoint = 'stake', ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_sign_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_unstake_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign unstake""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz2WmivuMG8MMRKMEmzKRMMxMApxZQWYNS4W', @@ -176,23 +172,22 @@ def test_sign_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path): entrypoint = 'unstake' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_sign_finalize_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_finalize_unstake_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign finalize_unstake""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz2WmivuMG8MMRKMEmzKRMMxMApxZQWYNS4W', @@ -205,23 +200,22 @@ def test_sign_finalize_unstake_transaction(app: TezosAppScreen, snapshot_dir: Pa entrypoint = 'finalize_unstake' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_sign_set_delegate_parameters_transaction(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_set_delegate_parameters_transaction(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign set delegate parameters""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz2WmivuMG8MMRKMEmzKRMMxMApxZQWYNS4W', @@ -243,23 +237,22 @@ def test_sign_set_delegate_parameters_transaction(app: TezosAppScreen, snapshot_ ]} ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_sign_with_long_hash(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_with_long_hash(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing transaction with a long destination hash""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -273,23 +266,22 @@ def test_sign_with_long_hash(app: TezosAppScreen, snapshot_dir: Path): parameter = {'int': 0} ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_ensure_always_clearsign(app: TezosAppScreen, snapshot_dir: Path): +def test_ensure_always_clearsign(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check clear signing never blindsign""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = Transaction( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -303,15 +295,14 @@ def test_ensure_always_clearsign(app: TezosAppScreen, snapshot_dir: Path): parameter = [{'prim':'pair','args':[{'string':"["},{'prim':'pair','args':[{'string':"Z"},{'prim':'pair','args':[{'string':"Y"},{'prim':'pair','args':[{'string':"X"},{'prim':'pair','args':[{'string':"W"},{'prim':'pair','args':[{'string':"V"},{'prim':'pair','args':[{'string':"U"},{'prim':'pair','args':[{'string':"T"},{'prim':'pair','args':[{'string':"S"},{'prim':'pair','args':[{'string':"R"},{'prim':'pair','args':[{'string':"Q"},{'prim':'pair','args':[{'string':"P"},{'prim':'pair','args':[{'string':"O"},{'prim':'pair','args':[{'string':"N"},{'prim':'pair','args':[{'string':"M"},{'prim':'pair','args':[{'string':"L"},{'prim':'pair','args':[{'string':"K"},{'prim':'pair','args':[{'string':"J"},{'prim':'pair','args':[{'string':"I"},{'prim':'pair','args':[{'string':"H"},{'prim':'pair','args':[{'string':"G"},{'prim':'pair','args':[{'string':"F"},{'prim':'pair','args':[{'string':"E"},{'prim':'pair','args':[{'string':"D"},{'prim':'pair','args':[{'string':"C"},{'prim':'pair','args':[{'string':"B"},[]]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]},{'prim':'pair','args':[{'int':10},{'prim':'pair','args':[{'int':9},{'prim':'pair','args':[{'int':8},{'prim':'pair','args':[{'int':7},{'prim':'pair','args':[{'int':6},{'prim':'pair','args':[{'int':5},{'prim':'pair','args':[{'int':4},{'prim':'pair','args':[{'int':3},{'prim':'pair','args':[{'int':2},{'prim':'pair','args':[{'int':1},[]]}]}]}]}]}]}]}]}]}]}] ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/operations/test_sign_transfer_ticket.py b/tests/integration/nano/test_sign/operations/test_sign_transfer_ticket.py index 30ad3b79f..c201a7df6 100755 --- a/tests/integration/nano/test_sign/operations/test_sign_transfer_ticket.py +++ b/tests/integration/nano/test_sign/operations/test_sign_transfer_ticket.py @@ -19,13 +19,15 @@ from pathlib import Path from conftest import requires_device -from utils.app import TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.message import TransferTicket +from utils.navigator import TezosNavigator -def test_sign_transfer_ticket(app: TezosAppScreen, snapshot_dir: Path): + +def test_sign_transfer_ticket(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing transfer ticket""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = TransferTicket( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -40,24 +42,23 @@ def test_sign_transfer_ticket(app: TezosAppScreen, snapshot_dir: Path): destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - @requires_device("nanosp") -def test_nanosp_regression_potential_empty_screen(app: TezosAppScreen, snapshot_dir: Path): +def test_nanosp_regression_potential_empty_screen(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check signing operation that display potentially empty screens""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() message = TransferTicket( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -73,15 +74,14 @@ def test_nanosp_regression_potential_empty_screen(app: TezosAppScreen, snapshot_ entrypoint = 'S\n\nS\nS\nS' ) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True, + snap_path=snapshot_dir + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/test_apdu_sign.py b/tests/integration/nano/test_sign/test_apdu_sign.py index ea34c387f..28d970d7d 100644 --- a/tests/integration/nano/test_sign/test_apdu_sign.py +++ b/tests/integration/nano/test_sign/test_apdu_sign.py @@ -16,91 +16,45 @@ """Gathering of tests related to Sign instructions.""" -from pathlib import Path - -from conftest import requires_device from utils.account import Account -from utils.app import send_and_navigate, Screen, ScreenText, TezosAppScreen, DEFAULT_ACCOUNT -from utils.message import Message, MichelineExpr, Transaction +from utils.backend import TezosBackend +from utils.message import MichelineExpr, Transaction +from utils.navigator import send_and_navigate, TezosNavigator -def test_sign_micheline_without_hash(app: TezosAppScreen, snapshot_dir: Path): - """Check signing micheline wihout getting hash""" - app.assert_screen(Screen.HOME) +def test_sign_micheline_without_hash(tezos_navigator: TezosNavigator, account: Account): + """Check signing micheline wihout getting hash""" message = MichelineExpr([{'string': 'CACA'}, {'string': 'POPO'}, {'string': 'BOUDIN'}]) - data = app.sign(DEFAULT_ACCOUNT, - message, - with_hash=False, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=False + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, with_hash=False, data=data) - app.quit() - -def test_sign_with_small_packet(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_with_small_packet( + backend: TezosBackend, + tezos_navigator: TezosNavigator, + account: Account): """Check signing using small packet instead of full size packets""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() - def check_sign_with_small_packet( - account: Account, - message: Message, - path: Path) -> None: + message = Transaction() - app.assert_screen(Screen.HOME) - - data = send_and_navigate( - send=lambda: app.backend.sign(account, message, apdu_size=10), - navigate=lambda: app.navigate_until_text(ScreenText.SIGN_ACCEPT, path)) - - app.checker.check_signature( - account, - message, - with_hash=False, - data=data) - - message = Transaction( - source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu', - fee = 50000, - counter = 8, - gas_limit = 54, - storage_limit = 45, - destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT', - amount = 240000, - entrypoint = 'do', - parameter = {'prim': 'CAR'} + data = send_and_navigate( + send=lambda: backend.sign(account, message, apdu_size=10), + navigate=tezos_navigator.navigate_sign_accept ) - check_sign_with_small_packet( - account=DEFAULT_ACCOUNT, + account.check_signature( message=message, - path=snapshot_dir) - - app.quit() - -@requires_device("nanosp") -def test_nanosp_regression_press_right_works_across_apdu_recieves(app: TezosAppScreen, snapshot_dir: Path): - """Check no need to click right two times between APDUs during signing flow""" - - app.assert_screen(Screen.HOME) - - message = MichelineExpr([{'prim':'IF_NONE','args':[[[{'prim':'SWAP'},{'prim':'IF','args':[[{'prim':'DIP','args':[[[{'prim':'DROP','args':[{'int':1}]},{'prim':'PUSH','args':[{'prim':'unit'},{'prim':'Unit'}]},{'prim':'PUSH','args':[{'prim':'bool'},{'prim':'True'}]},{'prim':'PUSH','args':[{'prim':'string'},{'string':';L\\S?p$-Fq)VDg\n]te\no4v0_8)\"'}]}]]]}],[[{'prim':'DROP','args':[{'int':2}]},{'prim':'PUSH','args':[{'prim':'unit'},{'prim':'Unit'}]},{'prim':'PUSH','args':[{'prim':'bool'},{'prim':'False'}]},{'prim':'PUSH','args':[{'prim':'string'},{'string':'Li-%*edF6~?E[5Kmu?dyviwJ^2\"\\d$FyQ>>!>D$g(Qg'}]},{'prim':'PUSH','args':[{'prim':'string'},{'string':'*Tx None: - app.navigate_until_text(ScreenText.ACCEPT_RISK, path / "clear_n_too_long_warning") - app.navigate_until_text(ScreenText.SIGN_ACCEPT, path / "summary") + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=path / "clear_n_too_long_warning" + ) + tezos_navigator.navigate_sign_accept(snap_path=path / "summary") - _sign_too_long(app, message, navigate) + _sign_too_long(tezos_navigator, account, message, navigate) def _reject_too_long( - app: TezosAppScreen, + tezos_navigator: TezosNavigator, + account: Account, message: Message, status_code: StatusCode, navigate: Callable[[], None]): """Reject a too long message""" - app.setup_expert_mode() - app.setup_blindsign_on() - - app._failing_signing( - DEFAULT_ACCOUNT, - message, - with_hash=True, - navigate=navigate, - status_code=status_code) + tezos_navigator.toggle_expert_mode() + tezos_navigator.toggle_blindsign() - app.quit() + with status_code.expected(): + tezos_navigator.sign( + account, + message, + with_hash=True, + navigate=navigate + ) ### Too long operation ### @@ -156,31 +162,38 @@ def _reject_too_long( ) ]) -def test_sign_basic_too_long_operation(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_basic_too_long_operation(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign too long operation""" - _sign_decodable_too_long(app, BASIC_OPERATION, snapshot_dir) + _sign_decodable_too_long(tezos_navigator, account, BASIC_OPERATION, snapshot_dir) -def test_reject_basic_too_long_operation_at_warning(app: TezosAppScreen, snapshot_dir: Path): +def test_reject_basic_too_long_operation_at_warning(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check reject too long operation at warning""" def navigate() -> None: - app.navigate_until_text(ScreenText.SIGN_REJECT, snapshot_dir / "clear_n_too_long_warning") + tezos_navigator.navigate_sign_reject( + snap_path=snapshot_dir / "clear_n_too_long_warning" + ) - _reject_too_long(app, BASIC_OPERATION, StatusCode.REJECT, navigate) + _reject_too_long(tezos_navigator, account, BASIC_OPERATION, StatusCode.REJECT, navigate) -def test_reject_basic_too_long_operation_at_summary(app: TezosAppScreen, snapshot_dir: Path): +def test_reject_basic_too_long_operation_at_summary(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check reject too long operation at summary""" def navigate() -> None: - app.navigate_until_text(ScreenText.ACCEPT_RISK, snapshot_dir / "clear_n_too_long_warning") - app.navigate_until_text(ScreenText.SIGN_REJECT, snapshot_dir / "summary") + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear_n_too_long_warning" + ) + tezos_navigator.navigate_sign_reject( + snap_path=snapshot_dir / "summary" + ) - _reject_too_long(app, BASIC_OPERATION, StatusCode.REJECT, navigate) + _reject_too_long(tezos_navigator, account, BASIC_OPERATION, StatusCode.REJECT, navigate) ### Different kind of too long operation ### -def test_sign_too_long_operation_with_only_transactions(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_too_long_operation_with_only_transactions(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign too long operation that contains only transaction""" message = OperationGroup([ Transaction( @@ -238,9 +251,9 @@ def test_sign_too_long_operation_with_only_transactions(app: TezosAppScreen, sna amount = 5000000 ) ]) - _sign_decodable_too_long(app, message, snapshot_dir) + _sign_decodable_too_long(tezos_navigator, account, message, snapshot_dir) -def test_sign_too_long_operation_without_fee_or_amount(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_too_long_operation_without_fee_or_amount(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign too long operation that doesn't have fees or amount""" message = Proposals( source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', @@ -268,7 +281,7 @@ def test_sign_too_long_operation_without_fee_or_amount(app: TezosAppScreen, snap ], period = 32 ) - _sign_decodable_too_long(app, message, snapshot_dir) + _sign_decodable_too_long(tezos_navigator, account, message, snapshot_dir) ### Too long operation containing a too large number ### @@ -323,147 +336,154 @@ def test_sign_too_long_operation_without_fee_or_amount(app: TezosAppScreen, snap ) ]) -def test_sign_too_long_operation_with_too_large(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_too_long_operation_with_too_large(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check sign too long operation that will also fail the parsing""" def navigate() -> None: - app.navigate_until_text(ScreenText.ACCEPT_RISK, snapshot_dir / "clear_n_too_large_warning") - app.navigate_until_text(ScreenText.SIGN_ACCEPT, snapshot_dir / "blindsigning") + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear_n_too_large_warning" + ) + tezos_navigator.navigate_sign_accept( + snap_path=snapshot_dir / "blindsigning" + ) - _sign_too_long(app, OPERATION_WITH_TOO_LARGE, navigate) + _sign_too_long(tezos_navigator, account, OPERATION_WITH_TOO_LARGE, navigate) -def test_reject_too_long_operation_with_too_large_at_too_large_warning(app: TezosAppScreen, snapshot_dir: Path): +def test_reject_too_long_operation_with_too_large_at_too_large_warning(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check reject too long operation that will also fail the parsing at too large warning""" def navigate() -> None: - app.navigate_until_text(ScreenText.SIGN_REJECT, snapshot_dir / "clear_n_too_large_warning") + tezos_navigator.navigate_sign_reject( + snap_path=snapshot_dir / "clear_n_too_large_warning" + ) - _reject_too_long(app, OPERATION_WITH_TOO_LARGE, StatusCode.PARSE_ERROR, navigate) + _reject_too_long(tezos_navigator, account, OPERATION_WITH_TOO_LARGE, StatusCode.PARSE_ERROR, navigate) -def test_reject_too_long_operation_with_too_large_at_blindsigning(app: TezosAppScreen, snapshot_dir: Path): +def test_reject_too_long_operation_with_too_large_at_blindsigning(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check reject too long operation that will also fail the parsing at blindsigning""" def navigate() -> None: - app.navigate_until_text(ScreenText.ACCEPT_RISK, snapshot_dir / "clear_n_too_large_warning") - app.navigate_until_text(ScreenText.SIGN_REJECT, snapshot_dir / "blindsigning") + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear_n_too_large_warning" + ) + tezos_navigator.navigate_sign_reject( + snap_path=snapshot_dir / "blindsigning" + ) - _reject_too_long(app, OPERATION_WITH_TOO_LARGE, StatusCode.REJECT, navigate) + _reject_too_long(tezos_navigator, account, OPERATION_WITH_TOO_LARGE, StatusCode.REJECT, navigate) -def test_blindsign_too_deep(app: TezosAppScreen, snapshot_dir: Path): +def test_blindsign_too_deep( + backend: TezosBackend, + firmware: Firmware, + tezos_navigator: TezosNavigator, + account: Account, + snapshot_dir: Path): """Check blindsigning on too deep expression""" - app.assert_screen(Screen.HOME) - expression = MichelineExpr([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[{'int':42}]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]) - if app.backend.firmware.device == "nanos": - def send(result_queue: Queue) -> None: - res = app.backend.sign(DEFAULT_ACCOUNT, expression, with_hash=True) - result_queue.put(res) - def assert_screen_i(i): - app.assert_screen(f"{str(i).zfill(5)}", snapshot_dir / "clear") - - result_queue: Queue = Queue() - send_process = Process(target=send, args=(result_queue,)) - send_process.start() - - app.backend.wait_for_text_not_on_screen(ScreenText.HOME) - - for i in range(6): - # 'Review operation' - # 'Expression {{{...{{{' - # 'Expression {{{...{{{' - # 'The transaction cannot be trusted.' - # 'Parsing error ERR_TOO_DEEP' - # 'Learn More: bit.ly/ledger-tez' - assert_screen_i(i) - app.backend.right_click() - - # 'Accept risk' screen - assert_screen_i(i+1) - - def blind_navigate() -> None: - app.navigate_until_text(ScreenText.SIGN_ACCEPT, snapshot_dir / "blind") - navigate_process = Process(target=blind_navigate) - navigate_process.start() - - app.backend.both_click() - - navigate_process.join() - assert navigate_process.exitcode == 0, "Should have terminate successfully" - - send_process.join() - assert send_process.exitcode == 0, "Should have terminate successfully" - - data = result_queue.get() - else: - data = app.blind_sign(DEFAULT_ACCOUNT, - expression, - with_hash=True, - path=snapshot_dir) - - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + def navigate() -> None: + if firmware == Firmware.NANOS: + ### Simulate `navigate_review` up to `ACCEPT_RISK` because the nanos screen can look like it hasn't changed. + + instructions: List[Union[NavIns, NavInsID]] = [ + # 'Review operation' + NavInsID.RIGHT_CLICK, # 'Expression {{{...{{{' + NavInsID.RIGHT_CLICK, # 'Expression {{{...{{{' + NavInsID.RIGHT_CLICK, # 'The transaction cannot be trusted.' + NavInsID.RIGHT_CLICK, # 'Parsing error ERR_TOO_DEEP' + NavInsID.RIGHT_CLICK, # 'Learn More: bit.ly/ledger-tez' + NavInsID.RIGHT_CLICK, # 'Accept risk' + NavInsID.BOTH_CLICK, + ] + + tezos_navigator.unsafe_navigate( + instructions=instructions, + screen_change_before_first_instruction=True, + screen_change_after_last_instruction=False, + snap_path=snapshot_dir / "clear", + ) + else: + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear" + ) + + tezos_navigator.navigate_sign_accept( + snap_path=snapshot_dir / "blind" + ) + + data = tezos_navigator.sign( + account, + expression, + with_hash=True, + navigate=navigate + ) + + account.check_signature( message=expression, with_hash=True, data=data) - app.quit() - -def test_blindsign_too_large(app: TezosAppScreen, snapshot_dir: Path): +def test_blindsign_too_large(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check blindsigning on too large expression""" - app.assert_screen(Screen.HOME) - message = MichelineExpr({'int':12345678901234567890123456789012345678901234567890123456789012345678901234567890}) - data = app.blind_sign(DEFAULT_ACCOUNT, - message=message, - with_hash=True, - path=snapshot_dir) + def navigate() -> None: + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear" + ) + tezos_navigator.navigate_sign_accept( + snap_path=snapshot_dir / "blind" + ) - app.checker.check_signature( - account=DEFAULT_ACCOUNT, + data = tezos_navigator.sign( + account, + message, + with_hash=True, + navigate=navigate + ) + + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - -def test_blindsign_reject_from_clear(app: TezosAppScreen, snapshot_dir: Path): +def test_blindsign_reject_from_clear(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check blindsigning rejection""" expression = MichelineExpr({'int':12345678901234567890123456789012345678901234567890123456789012345678901234567890}) - app.parsing_error_signing(DEFAULT_ACCOUNT, - expression, - with_hash=False, - path=snapshot_dir) - - app.quit() + with StatusCode.PARSE_ERROR.expected(): + tezos_navigator.reject_signing( + account, + expression, + with_hash=False, + snap_path=snapshot_dir + ) -def test_blindsign_reject_from_blind(app: TezosAppScreen, snapshot_dir: Path): +def test_blindsign_reject_from_blind(tezos_navigator: TezosNavigator, account: Account, snapshot_dir: Path): """Check blindsigning rejection""" expression = MichelineExpr({'int':12345678901234567890123456789012345678901234567890123456789012345678901234567890}) - def expected_failure_send() -> bytes: - with app.expect_apdu_failure(StatusCode.REJECT): - app.backend.sign(DEFAULT_ACCOUNT, expression, with_hash=False) - return b'' - def navigate() -> None: - app.navigate_until_text( - ScreenText.ACCEPT_RISK, - snapshot_dir / "clear" + tezos_navigator.navigate_review( + text=ScreenText.ACCEPT_RISK, + snap_path=snapshot_dir / "clear" ) - app.navigate_until_text( - ScreenText.SIGN_REJECT, - snapshot_dir / "blind" + tezos_navigator.navigate_sign_reject( + snap_path=snapshot_dir / "blind" ) - send_and_navigate( - send=expected_failure_send, - navigate=navigate) - - app.quit() + with StatusCode.REJECT.expected(): + tezos_navigator.sign( + account, + expression, + with_hash=False, + navigate=navigate + ) diff --git a/tests/integration/nano/test_sign/test_key.py b/tests/integration/nano/test_sign/test_key.py index cb1854aa1..1d3445163 100644 --- a/tests/integration/nano/test_sign/test_key.py +++ b/tests/integration/nano/test_sign/test_key.py @@ -16,13 +16,12 @@ """Gathering of tests related to Key signatures.""" -from pathlib import Path - import pytest from utils.account import Account, SigType -from utils.app import Screen, TezosAppScreen -from utils.message import MichelineExpr, Transaction +from utils.message import MichelineExpr +from utils.navigator import TezosNavigator + @pytest.mark.parametrize( "account", [ @@ -41,26 +40,22 @@ ], ids=lambda account: f"{account.sig_type}" ) -def test_sign_micheline_basic(app: TezosAppScreen, account: Account, snapshot_dir: Path): +def test_sign_with_another_sig(tezos_navigator: TezosNavigator, account: Account): """Check signing with ed25519""" - app.assert_screen(Screen.HOME) + message = MichelineExpr([{'int': 0}]) - message = MichelineExpr([{'string': 'CACA'}, {'string': 'POPO'}, {'string': 'BOUDIN'}]) - - data = app.sign(account, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True + ) - app.checker.check_signature( - account=account, + account.check_signature( message=message, with_hash=True, data=data) - app.quit() - @pytest.mark.parametrize( "seed", [ @@ -68,36 +63,24 @@ def test_sign_micheline_basic(app: TezosAppScreen, account: Account, snapshot_di ], ids=["seed21"] ) -def test_sign_with_another_seed(app: TezosAppScreen, snapshot_dir: Path): +def test_sign_with_another_seed(tezos_navigator: TezosNavigator): """Check signing using another seed than [zebra*24]""" - app.setup_expert_mode() + tezos_navigator.toggle_expert_mode() account = Account("m/44'/1729'/0'/0'", SigType.ED25519, "edpkupntwMyERpYniuK1GDWquPaPU1wYsQgMirJPLGmC4Y5dMUsQNo") - message = Transaction( - source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu', - fee = 50000, - counter = 8, - gas_limit = 54, - storage_limit = 45, - destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT', - amount = 240000, - entrypoint = 'do', - parameter = {'prim': 'CAR'} - ) + message = MichelineExpr([{'int': 0}]) - data = app.sign(account, - message, - with_hash=True, - path=snapshot_dir) + data = tezos_navigator.sign( + account, + message, + with_hash=True + ) - app.checker.check_signature( - account=account, + account.check_signature( message=message, with_hash=True, data=data) - - app.quit() diff --git a/tests/integration/nano/test_sign/test_parsing_errors.py b/tests/integration/nano/test_sign/test_parsing_errors.py index 2a9929d2a..fcd152cca 100755 --- a/tests/integration/nano/test_sign/test_parsing_errors.py +++ b/tests/integration/nano/test_sign/test_parsing_errors.py @@ -20,9 +20,11 @@ import pytest -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT +from utils.account import Account from utils.backend import StatusCode from utils.message import RawMessage +from utils.navigator import ScreenText, TezosNavigator + # Operation (0): Transaction # Source: tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu @@ -53,17 +55,18 @@ "one_byte_added_inside", ] ) -def test_parsing_error(app: TezosAppScreen, raw_msg: str, snapshot_dir: Path): +def test_parsing_error(tezos_navigator: TezosNavigator, raw_msg: str, account: Account, snapshot_dir: Path): """Check parsing error handling""" - app.setup_expert_mode() - - app.parsing_error_signing(DEFAULT_ACCOUNT, - RawMessage(raw_msg), - with_hash=True, - path=snapshot_dir) + tezos_navigator.toggle_expert_mode() - app.quit() + with StatusCode.PARSE_ERROR.expected(): + tezos_navigator.reject_signing( + account, + RawMessage(raw_msg), + with_hash=True, + snap_path=snapshot_dir + ) @pytest.mark.parametrize( "raw_msg", [ @@ -73,15 +76,18 @@ def test_parsing_error(app: TezosAppScreen, raw_msg: str, snapshot_dir: Path): "wrong_last_packet", ] ) -def test_parsing_hard_fail(app: TezosAppScreen, raw_msg: str, snapshot_dir: Path): +def test_parsing_hard_fail(tezos_navigator: TezosNavigator, raw_msg: str, account: Account, snapshot_dir: Path): """Check parsing error hard failing""" - app.setup_expert_mode() - - app.hard_failing_signing(DEFAULT_ACCOUNT, - RawMessage(raw_msg), - with_hash=True, - status_code=StatusCode.UNEXPECTED_SIGN_STATE, - path=snapshot_dir) - - app.quit() + tezos_navigator.toggle_expert_mode() + + with StatusCode.UNEXPECTED_SIGN_STATE.expected(): + tezos_navigator.sign( + account, + RawMessage(raw_msg), + with_hash=True, + navigate=lambda: tezos_navigator.navigate_review( + text=ScreenText.HOME, + snap_path=snapshot_dir + ) + ) diff --git a/tests/integration/nano/test_version.py b/tests/integration/nano/test_version.py index fd1dc3402..233482505 100755 --- a/tests/integration/nano/test_version.py +++ b/tests/integration/nano/test_version.py @@ -16,24 +16,41 @@ """Gathering of tests related to app version.""" -from utils.app import Screen, TezosAppScreen +import git -def test_version(app: TezosAppScreen): +from utils.backend import TezosBackend, Version + + +def test_version(backend: TezosBackend): """Test that the app version is the same as the current version.""" - app.assert_screen(Screen.HOME) + current_version = Version(Version.AppKind.WALLET, 3, 0, 6) - data = app.backend.version() + data = backend.version() - app.checker.check_version(data) + app_version = Version.from_bytes(data) - app.quit() + assert current_version == app_version, \ + f"Expected {current_version} but got {app_version}" -def test_git(app: TezosAppScreen): + +def test_git(backend: TezosBackend): """Test that the app commit is the same as the current git commit.""" - app.assert_screen(Screen.HOME) + git_repo = git.Repo(search_parent_directories=True) + git_describe = git_repo.git.describe( + tags=True, + abbrev=8, + always=True, + long=True, + dirty=True + ) + current_commit = git_describe.replace('-dirty', '*') + + data = backend.git() - data = app.backend.git() + assert data.endswith(b'\x00'), \ + f"Should end with by '\x00' but got {data.hex()}" - app.checker.check_commit(data) + app_commit = data[:-1].decode('utf-8') - app.quit() + assert current_commit == app_commit, \ + f"Expected {current_commit} but got {app_commit}" diff --git a/tests/integration/nano/test_wrong_apdu.py b/tests/integration/nano/test_wrong_apdu.py index 018e5db0b..1d4ca7b57 100644 --- a/tests/integration/nano/test_wrong_apdu.py +++ b/tests/integration/nano/test_wrong_apdu.py @@ -16,148 +16,111 @@ """Gathering of tests related to APDU checks.""" -from pathlib import Path from typing import Any, Callable, Union import pytest from utils.account import Account, SigType -from utils.app import Screen, TezosAppScreen, DEFAULT_ACCOUNT -from utils.backend import Cla, Index, Ins, StatusCode +from utils.backend import Cla, TezosBackend, Index, Ins, StatusCode from utils.message import Transaction +from utils.navigator import TezosNavigator -def test_regression_continue_after_reject(app: TezosAppScreen, snapshot_dir: Path): - """Check the app still runs after rejects signing""" - app.setup_expert_mode() +def test_regression_continue_after_reject( + backend: TezosBackend, + tezos_navigator: TezosNavigator, + account: Account): + """Check the app still runs after rejects signing""" - app.reject_public_key(DEFAULT_ACCOUNT, snapshot_dir / "reject_public_key") + tezos_navigator.toggle_expert_mode() - app.assert_screen(Screen.HOME) + with StatusCode.REJECT.expected(): + tezos_navigator.reject_public_key(account) - message = Transaction( - source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa', - fee = 10000, - counter = 2, - gas_limit = 3, - storage_limit = 4, - destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT', - amount = 0, - entrypoint = 'root', - parameter = [{'prim':'pair','args':[{'string':"["},{'prim':'pair','args':[{'string':"Z"},{'prim':'pair','args':[{'string':"Y"},{'prim':'pair','args':[{'string':"X"},{'prim':'pair','args':[{'string':"W"},{'prim':'pair','args':[{'string':"V"},{'prim':'pair','args':[{'string':"U"},{'prim':'pair','args':[{'string':"T"},{'prim':'pair','args':[{'string':"S"},{'prim':'pair','args':[{'string':"R"},{'prim':'pair','args':[{'string':"Q"},{'prim':'pair','args':[{'string':"P"},{'prim':'pair','args':[{'string':"O"},{'prim':'pair','args':[{'string':"N"},{'prim':'pair','args':[{'string':"M"},{'prim':'pair','args':[{'string':"L"},{'prim':'pair','args':[{'string':"K"},{'prim':'pair','args':[{'string':"J"},{'prim':'pair','args':[{'string':"I"},{'prim':'pair','args':[{'string':"H"},{'prim':'pair','args':[{'string':"G"},{'prim':'pair','args':[{'string':"F"},{'prim':'pair','args':[{'string':"E"},{'prim':'pair','args':[{'string':"D"},{'prim':'pair','args':[{'string':"C"},{'prim':'pair','args':[{'string':"B"},[]]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]},{'prim':'pair','args':[{'int':10},{'prim':'pair','args':[{'int':9},{'prim':'pair','args':[{'int':8},{'prim':'pair','args':[{'int':7},{'prim':'pair','args':[{'int':6},{'prim':'pair','args':[{'int':5},{'prim':'pair','args':[{'int':4},{'prim':'pair','args':[{'int':3},{'prim':'pair','args':[{'int':2},{'prim':'pair','args':[{'int':1},[]]}]}]}]}]}]}]}]}]}]}] - ) + backend.wait_for_home_screen() - app.reject_signing(DEFAULT_ACCOUNT, - message, - with_hash=True, - path=snapshot_dir / "reject_signing") + message = Transaction() - data = app.backend.get_public_key(DEFAULT_ACCOUNT, with_prompt=False) + with StatusCode.REJECT.expected(): + tezos_navigator.reject_signing( + account, + message, + with_hash=True + ) - app.checker.check_public_key(DEFAULT_ACCOUNT, data) + backend.get_public_key(account, with_prompt=False) - app.quit() -def test_change_sign_instruction(app: TezosAppScreen): +def test_change_sign_instruction(backend: TezosBackend, account: Account): """Check signing instruction changes behaviour""" - app.assert_screen(Screen.HOME) - - message = Transaction( - source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu', - fee = 50000, - counter = 8, - gas_limit = 54, - storage_limit = 45, - destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT', - amount = 240000, - entrypoint = 'do', - parameter = {'prim': 'CAR'} - ) - payload=bytes(message) + message = Transaction() + payload = bytes(message) - app.backend._ask_sign(Ins.SIGN_WITH_HASH, DEFAULT_ACCOUNT) + backend._ask_sign(Ins.SIGN_WITH_HASH, account) - with app.expect_apdu_failure(StatusCode.INVALID_INS): - app.backend._continue_sign(Ins.SIGN, - payload, - last=True) + with StatusCode.INVALID_INS.expected(): + backend._continue_sign( + Ins.SIGN, + payload, + last=True) - app.assert_screen(Screen.HOME) + backend._ask_sign(Ins.SIGN, account) - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) + with StatusCode.INVALID_INS.expected(): + backend._continue_sign( + Ins.SIGN_WITH_HASH, + payload, + last=True) - with app.expect_apdu_failure(StatusCode.INVALID_INS): - app.backend._continue_sign(Ins.SIGN_WITH_HASH, - payload, - last=True) - - app.quit() - -def test_mixing_command(app: TezosAppScreen): +def test_mixing_command(backend: TezosBackend, account: Account): """Check that mixing instruction fails""" - app.assert_screen(Screen.HOME) - - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend.version() - - app.assert_screen(Screen.HOME) - - app.backend._ask_sign(Ins.SIGN_WITH_HASH, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - - app.assert_screen(Screen.HOME) - - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend._ask_sign(Ins.SIGN_WITH_HASH, DEFAULT_ACCOUNT) - - app.assert_screen(Screen.HOME) + backend._ask_sign(Ins.SIGN, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend.version() - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend.get_public_key(DEFAULT_ACCOUNT, with_prompt=True) + backend._ask_sign(Ins.SIGN_WITH_HASH, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend._ask_sign(Ins.SIGN, account) - app.assert_screen(Screen.HOME) + backend._ask_sign(Ins.SIGN, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend._ask_sign(Ins.SIGN_WITH_HASH, account) - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend.get_public_key(DEFAULT_ACCOUNT, with_prompt=False) + backend._ask_sign(Ins.SIGN, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend.get_public_key(account, with_prompt=True) - app.assert_screen(Screen.HOME) + backend._ask_sign(Ins.SIGN, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend.get_public_key(account, with_prompt=False) - app.backend._ask_sign(Ins.SIGN, DEFAULT_ACCOUNT) - with app.expect_apdu_failure(StatusCode.UNEXPECTED_STATE): - app.backend.git() - - app.quit() + backend._ask_sign(Ins.SIGN, account) + with StatusCode.UNEXPECTED_STATE.expected(): + backend.git() @pytest.mark.parametrize("ins", [Ins.GET_PUBLIC_KEY, Ins.PROMPT_PUBLIC_KEY], ids=lambda ins: f"{ins}") @pytest.mark.parametrize("index", [Index.OTHER, Index.LAST], ids=lambda index: f"{index}") -def test_wrong_index(app: TezosAppScreen, ins: Ins, index: Index): +def test_wrong_index(backend: TezosBackend, account: Account, ins: Ins, index: Index): """Check wrong apdu index behaviour""" - app.assert_screen(Screen.HOME) - - with app.expect_apdu_failure(StatusCode.WRONG_PARAM): - app.backend._exchange(ins, - index=index, - sig_type=DEFAULT_ACCOUNT.sig_type, - payload=DEFAULT_ACCOUNT.path) - - app.quit() + with StatusCode.WRONG_PARAM.expected(): + backend._exchange( + ins, + index=index, + sig_type=account.sig_type, + payload=account.path + ) @pytest.mark.parametrize( "sender", [ - lambda app, account: app.backend.get_public_key(account, with_prompt=False), - lambda app, account: app.backend.get_public_key(account, with_prompt=True), - lambda app, account: app.backend._ask_sign(Ins.SIGN, account), - lambda app, account: app.backend._ask_sign(Ins.SIGN_WITH_HASH, account) + lambda backend, account: backend.get_public_key(account, with_prompt=False), + lambda backend, account: backend.get_public_key(account, with_prompt=True), + lambda backend, account: backend._ask_sign(Ins.SIGN, account), + lambda backend, account: backend._ask_sign(Ins.SIGN_WITH_HASH, account) ], ids=[ "get_pk_without_prompt", @@ -166,25 +129,21 @@ def test_wrong_index(app: TezosAppScreen, ins: Ins, index: Index): "sign_with_hash", ] ) -def test_wrong_derivation_type(app: TezosAppScreen, sender: Callable[[TezosAppScreen, Account], Any]): +def test_wrong_derivation_type(backend: TezosBackend, sender: Callable[[TezosBackend, Account], Any]): """Check wrong derivation type behaviour""" account = Account("m/44'/1729'/0'/0'", 0x04, "__unused__") - app.assert_screen(Screen.HOME) - - with app.expect_apdu_failure(StatusCode.WRONG_PARAM): - sender(app, account) - - app.quit() + with StatusCode.WRONG_PARAM.expected(): + sender(backend, account) @pytest.mark.parametrize( "sender", [ - lambda app, account: app.backend.get_public_key(account, with_prompt=False), - lambda app, account: app.backend.get_public_key(account, with_prompt=True), - lambda app, account: app.backend._ask_sign(Ins.SIGN, account), - lambda app, account: app.backend._ask_sign(Ins.SIGN_WITH_HASH, account) + lambda backend, account: backend.get_public_key(account, with_prompt=False), + lambda backend, account: backend.get_public_key(account, with_prompt=True), + lambda backend, account: backend._ask_sign(Ins.SIGN, account), + lambda backend, account: backend._ask_sign(Ins.SIGN_WITH_HASH, account) ], ids=[ "get_pk_without_prompt", @@ -216,22 +175,17 @@ def test_wrong_derivation_type(app: TezosAppScreen, sender: Callable[[TezosAppSc ] ) def test_wrong_derivation_path( - app: TezosAppScreen, + backend: TezosBackend, account: Account, - sender: Callable[[TezosAppScreen, Account], Any]): + sender: Callable[[TezosBackend, Account], Any]): """Check wrong derivation path behaviour""" - app.assert_screen(Screen.HOME) - - with app.expect_apdu_failure(StatusCode.WRONG_LENGTH_FOR_INS): - sender(app, account) - - app.quit() + with StatusCode.WRONG_LENGTH_FOR_INS.expected(): + sender(backend, account) @pytest.mark.parametrize("class_", [0x00, 0x81]) -def test_wrong_class(app: TezosAppScreen, class_: int): +def test_wrong_class(backend: TezosBackend, class_: int): """Check wrong apdu class behaviour""" - app.assert_screen(Screen.HOME) raw = \ class_.to_bytes(1, 'big') + \ @@ -240,10 +194,8 @@ def test_wrong_class(app: TezosAppScreen, class_: int): int(SigType.ED25519).to_bytes(1, 'big') + \ int(0x00).to_bytes(1, 'big') - with app.expect_apdu_failure(StatusCode.CLASS): - app.backend.exchange_raw(raw) - - app.quit() + with StatusCode.CLASS.expected(): + backend.exchange_raw(raw) @pytest.mark.parametrize( "size, data", @@ -253,9 +205,8 @@ def test_wrong_class(app: TezosAppScreen, class_: int): ], ids=lambda param: f"size={param}" if isinstance(param, int) else f"data={param}" ) -def test_wrong_apdu_length(app: TezosAppScreen, size: int, data: bytes): +def test_wrong_apdu_length(backend: TezosBackend, size: int, data: bytes): """Check wrong apdu length behaviour""" - app.assert_screen(Screen.HOME) raw = \ int(Cla.DEFAULT).to_bytes(1, 'big') + \ @@ -265,10 +216,8 @@ def test_wrong_apdu_length(app: TezosAppScreen, size: int, data: bytes): size.to_bytes(1, 'big') + \ data - with app.expect_apdu_failure(StatusCode.WRONG_LENGTH_FOR_INS): - app.backend.exchange_raw(raw) - - app.quit() + with StatusCode.WRONG_LENGTH_FOR_INS.expected(): + backend.exchange_raw(raw) @pytest.mark.parametrize( "ins", @@ -287,12 +236,8 @@ def test_wrong_apdu_length(app: TezosAppScreen, size: int, data: bytes): ], ids=lambda ins: f"ins={ins}" ) -def test_unimplemented_commands(app: TezosAppScreen, ins: Union[int, Ins]): +def test_unimplemented_commands(backend: TezosBackend, ins: Union[int, Ins]): """Check unimplemented commands""" - app.assert_screen(Screen.HOME) - - with app.expect_apdu_failure(StatusCode.INVALID_INS): - app.backend._exchange(ins) - - app.quit() + with StatusCode.INVALID_INS.expected(): + backend._exchange(ins) diff --git a/tests/integration/nano/utils/account.py b/tests/integration/nano/utils/account.py index 0ae640875..6fd077c80 100644 --- a/tests/integration/nano/utils/account.py +++ b/tests/integration/nano/utils/account.py @@ -17,10 +17,12 @@ from enum import IntEnum from typing import Union -import base58 from pytezos import pytezos +from pytezos.crypto.encoding import base58_encode +from pytezos.crypto.key import Key as PytezosKey from ragger.bip import pack_derivation_path +from .message import Message class SigType(IntEnum): """Class representing signature type.""" @@ -33,29 +35,20 @@ class SigType(IntEnum): def __str__(self) -> str: return self.name -class Signature: +class Signature(bytes): """Class representing signature.""" - GENERIC_SIGNATURE_PREFIX = bytes.fromhex("04822b") # sig(96) - - value: bytes - - def __init__(self, value: bytes): - value = Signature.GENERIC_SIGNATURE_PREFIX + value - self.value = base58.b58encode_check(value) - - def __repr__(self) -> str: - return self.value.hex() - - @classmethod - def from_tlv(cls, tlv: Union[bytes, bytearray]) -> 'Signature': - """Get Signature from tlv.""" + def __str__(self) -> str: + return self.decode() - if isinstance(tlv, bytes): - tlv = bytearray(tlv) + @staticmethod + def from_secp256_tlv(tlv: Union[bytes, bytearray]) -> bytes: + """Get the signature encapsulated in a TLV.""" # See: # https://developers.ledger.com/docs/embedded-app/crypto-api/lcx__ecdsa_8h/#cx_ecdsa_sign # TLV: 30 || L || 02 || Lr || r || 02 || Ls || s + if isinstance(tlv, bytes): + tlv = bytearray(tlv) header_tag_index = 0 # Remove the unwanted parity information set here. tlv[header_tag_index] &= ~0x01 @@ -80,101 +73,133 @@ def from_tlv(cls, tlv: Union[bytes, bytearray]) -> 'Signature': s = tlv[s_index : s_index + s_len] # Sometimes \x00 are added or removed # A size adjustment is required here. - def adjust_size(raw, size): - return raw[-size:].rjust(size, b'\x00') - return cls(adjust_size(r, 32) + adjust_size(s, 32)) + def adjust_size(data, size): + return data[-size:].rjust(size, b'\x00') + return adjust_size(r, 32) + adjust_size(s, 32) + + @classmethod + def from_bytes(cls, data: bytes, sig_type: SigType) -> 'Signature': + """Get the signature according to the SigType.""" + if sig_type in {SigType.ED25519, SigType.BIP32_ED25519}: + prefix = b'edsig' + elif sig_type == SigType.SECP256K1: + prefix = b'spsig' + data = Signature.from_secp256_tlv(data) + elif sig_type == SigType.SECP256R1: + prefix = b'p2sig' + data = Signature.from_secp256_tlv(data) + else: + assert False, f"Wrong signature type: {sig_type}" + + return cls(base58_encode(data, prefix)) + + +class PublicKey(bytes): + """Class representing public key.""" + + def __str__(self) -> str: + return self.decode() + + class CompressionKind(IntEnum): + """Bytes compression kind""" + EVEN = 0x02 + ODD = 0x03 + UNCOMPRESSED = 0x04 + + def __bytes__(self) -> bytes: + return bytes([self]) + + @classmethod + def from_bytes(cls, data: bytes, sig_type: Union[SigType, int]) -> 'PublicKey': + """Convert a public key from bytes to string""" + + length, data = data[0], data[1:] + assert length == len(data), f"Wrong data size, {length} != {len(data)}" + + # `data` should be: + # kind + pk + # pk length = 32 for compressed, 64 for uncompressed + kind = data[0] + data = data[1:] + + # Ed25519 + if sig_type in [ + SigType.ED25519, + SigType.BIP32_ED25519 + ]: + assert kind == cls.CompressionKind.EVEN, \ + f"Wrong Ed25519 public key compression kind: {kind}" + assert len(data) == 32, \ + f"Wrong Ed25519 public key length: {len(data)}" + return cls(base58_encode(data, b'edpk')) + + # Secp256 + if sig_type in [ + SigType.SECP256K1, + SigType.SECP256R1 + ]: + assert kind == cls.CompressionKind.UNCOMPRESSED, \ + f"Wrong Secp256 public key compression kind: {kind}" + assert len(data) == 2 * 32, \ + f"Wrong Secp256 public key length: {len(data)}" + kind = cls.CompressionKind.ODD if data[-1] & 1 else \ + cls.CompressionKind.EVEN + prefix = b'sppk' if sig_type == SigType.SECP256K1 \ + else b'p2pk' + data = bytes(kind) + data[:32] + return cls(base58_encode(data, prefix)) + + assert False, f"Wrong signature type: {sig_type}" + class Account: """Class representing account.""" path: bytes sig_type: Union[SigType, int] - public_key: str + __key: str def __init__(self, path: Union[str, bytes], sig_type: Union[SigType, int], - public_key: str): + key: str): self.path = \ pack_derivation_path(path) if isinstance(path, str) \ else path self.sig_type = sig_type - self.public_key = public_key + self.__key = key def __repr__(self) -> str: - return self.public_key + return self.__key @property - def base58_decoded(self) -> bytes: - """Decodes public_key from base58 encoding.""" - - # Get the public_key without prefix - public_key = base58.b58decode_check(self.public_key) - - if self.sig_type in [ - SigType.ED25519, - SigType.BIP32_ED25519 - ]: - prefix = bytes.fromhex("0d0f25d9") # edpk(54) - elif self.sig_type == SigType.SECP256K1: - prefix = bytes.fromhex("03fee256") # sppk(55) - elif self.sig_type == SigType.SECP256R1: - prefix = bytes.fromhex("03b28b7f") # p2pk(55) - else: - assert False, \ - "Account do not have a right signature type: {account.sig_type}" - assert public_key.startswith(prefix), \ - "Expected prefix {prefix.hex()} but got {public_key.hex()}" - - public_key = public_key[len(prefix):] - - if self.sig_type in [ - SigType.SECP256K1, - SigType.SECP256R1 - ]: - assert public_key[0] in [0x02, 0x03], \ - "Expected a prefix kind of 0x02 or 0x03 but got {public_key[0]}" - public_key = public_key[1:] - - return public_key + def key(self) -> PytezosKey: + """pytezos key of the account.""" + return pytezos.using(key=self.__key).key + + def check_signature( + self, + data: bytes, + message: Message, + with_hash: bool): + """Checks if signature correspond to a signature of message sign by the account.""" + if with_hash: + assert data.startswith(message.hash), \ + f"Expected a starting hash {message.hash.hex()} but got {data.hex()}" + data = data[len(message.hash):] - def check_public_key(self, data: bytes) -> None: - """Checks if the data correspond to the public_key.""" + signature = Signature.from_bytes(data, SigType(self.sig_type)) - # `data` should be: - # length + kind + pk - # kind : 02=odd, 03=even, 04=uncompressed - # pk length = 32 for compressed, 64 for uncompressed - assert len(data) == data[0] + 1 - if data[1] == 0x04: # public key uncompressed - assert data[0] == 1 + 32 + 32 - elif data[1] in [0x02, 0x03]: # public key even or odd (compressed) - assert data[0] == 1 + 32 - else: - assert False, \ - "Expected a prefix kind of 0x02, 0x03 or 0x04 but got {data[1]}" - data = data[2:2+32] + assert self.key.verify(signature, bytes(message)), \ + f"Fail to verify signature {signature!r}, \n\ + with account {self} \n\ + and message {message}" - public_key = self.base58_decoded - assert data == public_key, \ - f"Expected public key {public_key.hex()} but got {data.hex()}" - def check_signature(self, - signature: Union[bytes, Signature], - message: Union[str, bytes]): - """Checks if signature correspond to a signature of message sign by the account.""" +DEFAULT_SEED = ' '.join(['zebra']*24) - if isinstance(message, str): - message = bytes.fromhex(message) - if isinstance(signature, bytes): - signature = Signature(signature) \ - if self.sig_type in [ - SigType.ED25519, - SigType.BIP32_ED25519 - ] \ - else Signature.from_tlv(signature) - ctxt = pytezos.using(key=self.public_key) - assert ctxt.key.verify(signature.value, message), \ - f"Fail to verify signature {signature}, \n\ - with account {self} \n\ - and message {message.hex()}" +DEFAULT_ACCOUNT = Account( + "m/44'/1729'/0'/0'", + SigType.ED25519, + "edpkuXX2VdkdXzkN11oLCb8Aurdo1BTAtQiK8ZY9UPj2YMt3AHEpcY" +) diff --git a/tests/integration/nano/utils/app.py b/tests/integration/nano/utils/app.py deleted file mode 100644 index d2fbedf69..000000000 --- a/tests/integration/nano/utils/app.py +++ /dev/null @@ -1,472 +0,0 @@ -# Copyright 2023 Trilitech -# Copyright 2023 Functori - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tezos app backend.""" - -from contextlib import contextmanager -from enum import Enum -from io import BytesIO -from multiprocessing import Process, Queue -from pathlib import Path -import time -from typing import Callable, Generator, List, Optional, Tuple, Union - -import requests -import git -from ragger.backend import SpeculosBackend -from ragger.error import ExceptionRAPDU -from ragger.navigator import NavInsID, NanoNavigator - -from .message import Message -from .account import Account, SigType -from .backend import StatusCode, TezosBackend, AppKind - -version: Tuple[int, int, int] = (3, 0, 6) - -class TezosAPDUChecker: - """Helper to check APDU received.""" - - app_kind: AppKind - - def __init__(self, app_kind: AppKind): - self.app_kind = app_kind - - @property - def commit(self) -> bytes: - """Current commit.""" - repo = git.Repo(".") - commit = repo.head.commit.hexsha[:8] - if repo.is_dirty(): - commit += "*" - return bytes.fromhex(commit.encode('utf-8').hex() + "00") - - @property - def version_bytes(self) -> bytes: - """Current version in bytes.""" - return \ - self.app_kind.to_bytes(1, byteorder='big') + \ - version[0].to_bytes(1, byteorder='big') + \ - version[1].to_bytes(1, byteorder='big') + \ - version[2].to_bytes(1, byteorder='big') - - def check_commit(self, commit: bytes) -> None: - """Check if the commit is the current commit.""" - assert commit == self.commit, \ - f"Expected commit {self.commit.hex()} but got {commit.hex()}" - - def check_version(self, raw_version: bytes) -> None: - """Check if the version is the current version.""" - assert raw_version == self.version_bytes, \ - f"Expected version {self.version_bytes.hex()} but got {raw_version.hex()}" - - def check_public_key(self, - account: Account, - public_key: bytes) -> None: - """Check that public_key is the account public key.""" - account.check_public_key(public_key) - - def check_signature(self, - account: Account, - message: Message, - with_hash: bool, - data: bytes) -> None: - """Check that data is a signature of message from account.""" - if with_hash: - assert data.startswith(message.hash), \ - f"Expected a starting hash {message.hash.hex()} but got {data.hex()}" - - data = data[len(message.hash):] - - account.check_signature(data, bytes(message)) - -MAX_ATTEMPTS = 50 - -def with_retry(f, attempts=MAX_ATTEMPTS): - """Try f until it succeeds or has been executed attempts times.""" - while True: - try: - return f() - except Exception as e: - if attempts <= 0: - print("- with_retry: attempts exhausted -") - raise e - attempts -= 1 - # Give plenty of time for speculos to update - can take a long time on CI machines - time.sleep(0.5) - -def run_simultaneously(processes: List[Process]) -> None: - """Executes multiples process at the same time.""" - - for process in processes: - process.start() - - for process in processes: - process.join() - assert process.exitcode == 0, "Should have terminate successfully" - -def send_and_navigate(send: Callable[[], bytes], navigate: Callable[[], None]) -> bytes: - """Sends APDU and navigates.""" - - def _send(result_queue: Queue) -> None: - res = send() - result_queue.put(res) - - result_queue: Queue = Queue() - send_process = Process(target=_send, args=(result_queue,)) - navigate_process = Process(target=navigate) - run_simultaneously([navigate_process, send_process]) - return result_queue.get() - -class SpeculosTezosBackend(TezosBackend, SpeculosBackend): - """Class representing Tezos app running on Speculos.""" - - # speculos can be slow to start up in a slow environment. - # Here, we expect a little more - def __enter__(self) -> "SpeculosTezosBackend": - try: - super().__enter__() - return self - except Exception: - process = self._client.process - try: - with_retry(self._client._wait_until_ready, attempts=5) - super().__enter__() - except Exception as e: - self._client.stop() - # do not forget to close the first process - self._client.process = process - self._client.stop() - raise e - # replace the new process by the first one - self._client.process.kill() - self._client.process.wait() - self._client.process = process - return self - -class Screen(str, Enum): - """Class representing common, known app screens.""" - - HOME = "home" - VERSION = "version" - SETTINGS = "settings" - SETTINGS_EXPERT_MODE_DISABLED = "settings_expert_mode_disabled" - SETTINGS_EXPERT_MODE_ENABLED = "settings_expert_mode_enabled" - SETTINGS_BLINDSIGN_ON = "settings_blindsign_on" - SETTINGS_BLINDSIGN_OFF = "settings_blindsign_off" - SETTINGS_BACK = "back" - QUIT = "quit" - - def __str__(self) -> str: - return self.value - -class ScreenText(str, Enum): - """Class representing common, known app screen's text.""" - - HOME = "Application" - PUBLIC_KEY_APPROVE = "Approve" - PUBLIC_KEY_REJECT = "Reject" - SIGN_ACCEPT = "Accept" - SIGN_REJECT = "Reject" - ACCEPT_RISK = "Accept risk" - BACK_HOME = "Home" - BLINDSIGN = "blindsign" - BLINDSIGN_NANOS = "Blindsign" - - @classmethod - def blindsign(cls, backend: SpeculosTezosBackend) -> "ScreenText": - """Get blindsign text depending on device.""" - if backend.firmware.device == "nanos": - return cls.BLINDSIGN_NANOS - - return cls.BLINDSIGN - -class TezosAppScreen(): - """Class representing Tezos app management.""" - - backend: SpeculosTezosBackend - checker: TezosAPDUChecker - path: Path - snapshots_dir: Path - tmp_snapshots_dir: Path - snapshotted: List[str] - golden_run: bool - navigator: NanoNavigator - - def __init__(self, - backend: SpeculosTezosBackend, - app_kind: AppKind, - golden_run: bool): - self.backend = backend - self.checker = TezosAPDUChecker(app_kind) - - self.path = Path(__file__).resolve().parent.parent - self.snapshots_dir = self.path / "snapshots" / backend.firmware.name - self.tmp_snapshots_dir = self.path / "snapshots-tmp" / backend.firmware.name - if not self.snapshots_dir.is_dir() and golden_run: - self.snapshots_dir.mkdir(parents=True) - if not self.tmp_snapshots_dir.is_dir(): - self.tmp_snapshots_dir.mkdir(parents=True) - self.snapshotted = [] - - self.golden_run = golden_run - self.navigator = NanoNavigator(backend, backend.firmware, golden_run) - - def __enter__(self) -> "TezosAppScreen": - with_retry(self.backend.__enter__, attempts=3) - return self - - def __exit__(self, *args): - self.backend.__exit__(*args) - - def assert_screen(self, - screen: Union[str, Screen], - path: Optional[Union[str, Path]] = None) -> None: - """Check if the screen is the one expected.""" - golden_run = self.golden_run and screen not in self.snapshotted - if golden_run: - self.snapshotted = self.snapshotted + [screen] - input(f"Press ENTER to snapshot {screen}") - - snapshots_dir = self.snapshots_dir if path is None \ - else self.snapshots_dir / path - tmp_snapshots_dir = self.tmp_snapshots_dir if path is None \ - else self.tmp_snapshots_dir / path - - if not snapshots_dir.is_dir() and golden_run: - snapshots_dir.mkdir(parents=True) - if not tmp_snapshots_dir.is_dir(): - tmp_snapshots_dir.mkdir(parents=True) - - path = snapshots_dir / f'{screen}.png' - tmp_path = tmp_snapshots_dir / f'{screen}.png' - def check(): - print(f"- Expecting {screen} -") - assert self.backend.compare_screen_with_snapshot( - path, - tmp_snap_path=tmp_path, - golden_run=golden_run) - - with_retry(check) - self.backend._last_screenshot = BytesIO(self.backend._client.get_screenshot()) - - def setup_expert_mode(self) -> None: - """Enable expert-mode from home screen.""" - self.assert_screen(Screen.HOME) - self.backend.right_click() - self.assert_screen(Screen.VERSION) - self.backend.right_click() - self.assert_screen(Screen.SETTINGS) - self.backend.both_click() - self.assert_screen(Screen.SETTINGS_EXPERT_MODE_DISABLED) - self.backend.both_click() - self.assert_screen(Screen.SETTINGS_EXPERT_MODE_ENABLED) - self.backend.left_click() - self.assert_screen(Screen.SETTINGS_BACK) - self.backend.both_click() - self.assert_screen(Screen.HOME) - - def setup_blindsign_on(self) -> None: - """Enable blindsign from home screen.""" - self.assert_screen(Screen.HOME) - self.backend.right_click() - self.assert_screen(Screen.VERSION) - self.backend.right_click() - self.assert_screen(Screen.SETTINGS) - self.backend.both_click() - # expert_mode screen - self.backend.right_click() - self.assert_screen(Screen.SETTINGS_BLINDSIGN_OFF) - self.backend.both_click() - self.assert_screen(Screen.SETTINGS_BLINDSIGN_ON) - self.backend.right_click() - self.assert_screen(Screen.SETTINGS_BACK) - self.backend.both_click() - self.assert_screen(Screen.HOME) - - def _quit(self) -> None: - """Ensure quiting exit the app.""" - self.assert_screen(Screen.QUIT) - try: - self.backend.both_click() - assert False, "Must have lost connection with speculos" - except requests.exceptions.ConnectionError: - pass - - def quit(self) -> None: - """Quit the app from home screen.""" - self.assert_screen(Screen.HOME) - self.backend.right_click() - self.assert_screen(Screen.VERSION) - self.backend.right_click() - self.assert_screen(Screen.SETTINGS) - self.backend.right_click() - self._quit() - - def navigate_until_text(self, text: ScreenText, path: Union[str, Path]) -> None: - """Click right until the expected text is displayed, then both click.""" - if isinstance(path, str): - path = Path(path) - self.navigator.\ - navigate_until_text_and_compare(NavInsID.RIGHT_CLICK, - [NavInsID.BOTH_CLICK], - text, - path=self.path, - test_case_name=path, - screen_change_after_last_instruction=False) - - @contextmanager - def expect_apdu_failure(self, code: StatusCode) -> Generator[None, None, None]: - """Expect the body to fail with code.""" - try: - yield - assert False, f"Expect fail with { code } but succeed" - except ExceptionRAPDU as e: - failing_code = StatusCode(e.status) - assert code == failing_code, \ - f"Expect fail with { code.name } but fail with { failing_code.name }" - - def _failing_send(self, - send: Callable[[], bytes], - navigate: Callable[[], None], - status_code: StatusCode) -> None: - """Expect that send and navigates fails with status_code.""" - def expected_failure_send() -> bytes: - with self.expect_apdu_failure(status_code): - send() - return b'' - - send_and_navigate( - send=expected_failure_send, - navigate=navigate) - - def provide_public_key(self, - account: Account, - path: Union[str, Path]) -> bytes: - """Get the account's public key from the app after approving it.""" - return send_and_navigate( - send=lambda: self.backend.get_public_key(account, with_prompt=True), - navigate=lambda: self.navigate_until_text(ScreenText.PUBLIC_KEY_APPROVE, path)) - - def reject_public_key(self, - account: Account, - path: Union[str, Path]) -> None: - """Reject the account's public key.""" - self._failing_send( - send=(lambda: self.backend.get_public_key(account, with_prompt=True)), - navigate=(lambda: self.navigate_until_text( - ScreenText.PUBLIC_KEY_REJECT, - path)), - status_code=StatusCode.REJECT) - - def _sign(self, - account: Account, - message: Message, - with_hash: bool, - navigate: Callable[[], None]) -> bytes: - """Requests to sign the message with account and navigates.""" - return send_and_navigate( - send=(lambda: self.backend.sign(account, message, with_hash)), - navigate=navigate) - - def sign(self, - account: Account, - message: Message, - with_hash: bool, - path: Union[str, Path]) -> bytes: - """Sign the message with account.""" - return self._sign( - account, - message, - with_hash, - navigate=lambda: self.navigate_until_text(ScreenText.SIGN_ACCEPT, path)) - - def blind_sign(self, - account: Account, - message: Message, - with_hash: bool, - path: Union[str, Path]) -> bytes: - """Blindsign the message with account.""" - if isinstance(path, str): - path = Path(path) - - def navigate() -> None: - self.navigate_until_text(ScreenText.ACCEPT_RISK, path / "clear") - self.navigate_until_text(ScreenText.SIGN_ACCEPT, path / "blind") - - return send_and_navigate( - send=(lambda: self.backend.sign(account, message, with_hash)), - navigate=navigate) - - def _failing_signing(self, - account: Account, - message: Message, - with_hash: bool, - navigate: Callable[[], None], - status_code: StatusCode) -> None: - """Expect requests signing and navigate fails with status_code.""" - self._failing_send( - send=(lambda: self.backend.sign(account, message, with_hash)), - navigate=navigate, - status_code=status_code) - - def reject_signing(self, - account: Account, - message: Message, - with_hash: bool, - path: Union[str, Path]) -> None: - """Request and reject signing the message.""" - self._failing_signing( - account, - message, - with_hash, - navigate=(lambda: self.navigate_until_text( - ScreenText.SIGN_REJECT, - path)), - status_code=StatusCode.REJECT) - - def hard_failing_signing(self, - account: Account, - message: Message, - with_hash: bool, - status_code: StatusCode, - path: Union[str, Path]) -> None: - """Expect the signing request to hard fail.""" - self._failing_signing(account, - message, - with_hash, - navigate=(lambda: self.navigate_until_text( - ScreenText.HOME, - path)), - status_code=status_code) - - def parsing_error_signing(self, - account: Account, - message: Message, - with_hash: bool, - path: Union[str, Path]) -> None: - """Expect the signing request to fail with parsing error.""" - self._failing_signing(account, - message, - with_hash, - navigate=(lambda: self.navigate_until_text( - ScreenText.SIGN_REJECT, - path)), - status_code=StatusCode.PARSE_ERROR) - -DEFAULT_SEED = 'zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra zebra' - -DEFAULT_ACCOUNT = Account("m/44'/1729'/0'/0'", - SigType.ED25519, - "edpkuXX2VdkdXzkN11oLCb8Aurdo1BTAtQiK8ZY9UPj2YMt3AHEpcY") diff --git a/tests/integration/nano/utils/backend.py b/tests/integration/nano/utils/backend.py index 3ac303df6..6a87676b0 100644 --- a/tests/integration/nano/utils/backend.py +++ b/tests/integration/nano/utils/backend.py @@ -14,15 +14,66 @@ """Tezos app backend.""" +from contextlib import contextmanager from enum import IntEnum -from typing import Union +import time +from struct import unpack +from typing import Generator, Union +from ragger.backend import SpeculosBackend from ragger.backend.interface import BackendInterface, RAPDU from ragger.error import ExceptionRAPDU from .account import Account, SigType from .message import Message + +class Version: + """Class representing the version.""" + + class AppKind(IntEnum): + """Class representing the kind of app.""" + + WALLET = 0x00 + BAKING = 0x01 + + def __str__(self) -> str: + return self.name + + app_kind: AppKind + major: int + minor: int + patch: int + + def __init__(self, + app_kind: AppKind, + major: int, + minor: int, + patch: int): + self.app_kind = app_kind + self.major = major + self.minor = minor + self.patch = patch + + def __repr__(self) -> str: + return f"App {self.app_kind}: {self.major}.{self.minor}.{self.patch}" + + def __eq__(self, other: object): + if not isinstance(other, Version): + return NotImplemented + return \ + self.app_kind == other.app_kind and \ + self.major == other.major and \ + self.minor == other.minor and \ + self.patch == other.patch + + @classmethod + def from_bytes(cls, raw: bytes) -> 'Version': + """Create a version from bytes.""" + (app_kind, major, minor, patch) = unpack(' str: return self.name -class AppKind(IntEnum): - """Class representing the kind of app.""" + @contextmanager + def expected(self) -> Generator[None, None, None]: + """Fail if the right RAPDU code exception is not raise.""" + try: + yield + assert self == StatusCode.OK, \ + f"Expect fail with {self} but succeed" + except ExceptionRAPDU as e: + try: + status = f"{StatusCode(e.status)}" + except ValueError: + status = f"0x{e.status:x}" + assert self == e.status, \ + f"Expect fail with {self} but fail with {status}" - WALLET = 0x00 - BAKING = 0x01 - - def __str__(self) -> str: - return self.name MAX_APDU_SIZE: int = 235 @@ -182,3 +240,44 @@ def sign(self, assert not data, f"No data expected but got {data.hex()}" assert False, "We should have already returned" + +MAX_ATTEMPTS = 50 + +def with_retry(f, attempts=MAX_ATTEMPTS): + """Try f until it succeeds or has been executed attempts times.""" + while True: + try: + return f() + except Exception as e: + if attempts <= 0: + print("- with_retry: attempts exhausted -") + raise e + attempts -= 1 + # Give plenty of time for speculos to update - can take a long time on CI machines + time.sleep(0.5) + +class SpeculosTezosBackend(TezosBackend, SpeculosBackend): + """Class representing Tezos app running on Speculos.""" + + # speculos can be slow to start up in a slow environment. + # Here, we expect a little more + def __enter__(self) -> "SpeculosTezosBackend": + try: + super().__enter__() + return self + except Exception: + process = self._client.process + try: + with_retry(self._client._wait_until_ready, attempts=5) + super().__enter__() + except Exception as e: + self._client.stop() + # do not forget to close the first process + self._client.process = process + self._client.stop() + raise e + # replace the new process by the first one + self._client.process.kill() + self._client.process.wait() + self._client.process = process + return self diff --git a/tests/integration/nano/utils/message.py b/tests/integration/nano/utils/message.py index 209e06ccf..1c849c321 100644 --- a/tests/integration/nano/utils/message.py +++ b/tests/integration/nano/utils/message.py @@ -47,6 +47,9 @@ def hash(self) -> bytes: def __bytes__(self) -> bytes: raise NotImplementedError + def __str__(self) -> str: + return bytes(self).hex() + class RawMessage(Message): """Class representing a raw message.""" diff --git a/tests/integration/nano/utils/navigator.py b/tests/integration/nano/utils/navigator.py new file mode 100644 index 000000000..f8bf988f4 --- /dev/null +++ b/tests/integration/nano/utils/navigator.py @@ -0,0 +1,285 @@ +# Copyright 2023 Trilitech +# Copyright 2023 Functori + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tezos app backend.""" + +from enum import Enum +from multiprocessing.pool import ThreadPool +from pathlib import Path +import time +from typing import Callable, List, Optional, TypeVar, Union + +from ragger.firmware import Firmware +from ragger.navigator import NavIns, NavInsID, Navigator + +from .message import Message +from .account import Account +from .backend import TezosBackend + + +RESPONSE = TypeVar('RESPONSE') + +def send_and_navigate( + send: Callable[[], RESPONSE], + navigate: Callable[[], None], + timeout: float = 300.0 +) -> RESPONSE: + """Sends a request and navigates before receiving a response.""" + + with ThreadPool(processes=2) as pool: + + t = 0.0 + send_res = pool.apply_async(send) + navigate_res = pool.apply_async(navigate) + + while True: + if send_res.ready(): + result = send_res.get() + navigate_res.get() + break + if navigate_res.ready(): + navigate_res.get() + result = send_res.get() + break + time.sleep(0.1) + t += 0.1 + if timeout is not None and timeout < t: + raise TimeoutError("Timeout waiting for Send and Navigate") + + return result + + +class ScreenText(str, Enum): + """Class representing common, known app screen's text.""" + + HOME = "Application" + PUBLIC_KEY_APPROVE = "Approve" + PUBLIC_KEY_REJECT = "Reject" + SIGN_ACCEPT = "Accept" + SIGN_REJECT = "Reject" + ACCEPT_RISK = "Accept risk" + BACK_HOME = "Home" + BLINDSIGN = "blindsign" + BLINDSIGN_NANOS = "Blindsign" + + @classmethod + def blindsign(cls, backend: TezosBackend) -> "ScreenText": + """Get blindsign text depending on device.""" + if backend.firmware == Firmware.NANOS: + return cls.BLINDSIGN_NANOS + + return cls.BLINDSIGN + + +class TezosNavigator(): + """Class representing Tezos app navigation.""" + + _backend: TezosBackend + _root_dir: Path + _navigator: Navigator + + def __init__(self, + backend: TezosBackend, + navigator: Navigator): + self._backend = backend + self._root_dir = Path(__file__).resolve().parent.parent + self._navigator = navigator + + def navigate(self, + snap_path: Optional[Path] = None, + screen_change_before_first_instruction: bool = False, + **kwargs) -> None: + """Wrapper of `navigator.navigate_and_compare`""" + self._navigator.navigate_and_compare( + path=self._root_dir, + test_case_name=snap_path, + screen_change_before_first_instruction=screen_change_before_first_instruction, + **kwargs + ) + + def navigate_until_text(self, + snap_path: Optional[Path] = None, + screen_change_before_first_instruction: bool = False, + validation_instructions: List[Union[NavIns, NavInsID]] = [], + **kwargs) -> None: + """Wrapper of `navigator.navigate_until_text_and_compare`""" + self._navigator.navigate_until_text_and_compare( + path=self._root_dir, + test_case_name=snap_path, + screen_change_before_first_instruction=screen_change_before_first_instruction, + validation_instructions=validation_instructions, + **kwargs + ) + + def unsafe_navigate( + self, + instructions: List[Union[NavIns, NavInsID]], + snap_path: Optional[Path] = None, + timeout: float = 10.0, + screen_change_before_first_instruction: bool = False, + screen_change_after_last_instruction: bool = True, + snap_start_idx: int = 0) -> None: + """Navigate using instructions but do not wait for screens to + change. Only use this function if consecutive screens are the + same. + + Function based on `ragger.navigator.navigate_and_compare` + + """ + self._backend.pause_ticker() + self._navigator._run_instruction( + NavIns(NavInsID.WAIT, (0, )), + timeout, + wait_for_screen_change=screen_change_before_first_instruction, + path=self._root_dir, + test_case_name=snap_path, + snap_idx=snap_start_idx + ) + for idx, instruction in enumerate(instructions): + if idx + 1 != len(instructions) or screen_change_after_last_instruction: + self._navigator._run_instruction( + instruction, + timeout, + wait_for_screen_change=False, + path=self._root_dir, + test_case_name=snap_path, + snap_idx=snap_start_idx + idx + 1 + ) + else: + self._navigator._run_instruction( + instruction, + timeout, + wait_for_screen_change=False, + snap_idx=snap_start_idx + idx + 1 + ) + self._backend.resume_ticker() + + def navigate_to_settings(self, **kwargs) -> int: + """Navigate from Home screen to settings.""" + instructions: List[Union[NavIns, NavInsID]] = [ + # Home + NavInsID.RIGHT_CLICK, # Version + NavInsID.RIGHT_CLICK, # Settings + NavInsID.BOTH_CLICK, + ] + self.navigate(instructions=instructions, **kwargs) + snap_start_idx = kwargs['snap_start_idx'] if 'snap_start_idx' in kwargs else 0 + return snap_start_idx + len(instructions) + + def toggle_expert_mode(self, **kwargs) -> int: + """Enable expert-mode from home screen.""" + go_to_settings_kwargs = kwargs.copy() + go_to_settings_kwargs['screen_change_after_last_instruction'] = True + snap_idx = self.navigate_to_settings(**go_to_settings_kwargs) + + instructions: List[Union[NavIns, NavInsID]] = [ + # Expert Mode + NavInsID.BOTH_CLICK, + NavInsID.RIGHT_CLICK, # Blind Sign + NavInsID.RIGHT_CLICK, # Back + NavInsID.BOTH_CLICK, # Home + ] + kwargs['snap_start_idx'] = snap_idx + kwargs['screen_change_before_first_instruction'] = False + self.navigate(instructions=instructions, **kwargs) + + return snap_idx + len(instructions) + + def toggle_blindsign(self, **kwargs) -> int: + """Enable blindsign from home screen.""" + go_to_settings_kwargs = kwargs.copy() + go_to_settings_kwargs['screen_change_after_last_instruction'] = True + snap_idx = self.navigate_to_settings(**go_to_settings_kwargs) + + instructions: List[Union[NavIns, NavInsID]] = [ + # Expert Mode + NavInsID.RIGHT_CLICK, # Blind Sign + NavInsID.BOTH_CLICK, + NavInsID.RIGHT_CLICK, # Back + NavInsID.BOTH_CLICK, # Home + ] + kwargs['snap_start_idx'] = snap_idx + kwargs['screen_change_before_first_instruction'] = False + self.navigate(instructions=instructions, **kwargs) + + return snap_idx + len(instructions) + + def navigate_forward(self, **kwargs) -> None: + """Navigate forward until the text is found.""" + self.navigate_until_text(navigate_instruction=NavInsID.RIGHT_CLICK, **kwargs) + + def navigate_review(self, + screen_change_before_first_instruction=True, + screen_change_after_last_instruction=False, + **kwargs) -> None: + """Navigate forward until the text is found. Confirm at the end.""" + self.navigate_forward( + validation_instructions=[NavInsID.BOTH_CLICK], + screen_change_before_first_instruction=screen_change_before_first_instruction, + screen_change_after_last_instruction=screen_change_after_last_instruction, + **kwargs + ) + + def provide_public_key(self, + account: Account, + navigate: Optional[Callable] = None, + **kwargs) -> bytes: + """Send a get public key request and navigate""" + if navigate is None: + def navigate(): + self.navigate_review(text=ScreenText.PUBLIC_KEY_APPROVE, **kwargs) + return send_and_navigate( + send=lambda: self._backend.get_public_key(account, with_prompt=True), + navigate=navigate + ) + + def reject_public_key(self, account: Account, **kwargs) -> bytes: + """Send a get public key request and navigate in order to reject it""" + def navigate(): + self.navigate_review(text=ScreenText.PUBLIC_KEY_REJECT, **kwargs) + return self.provide_public_key(account, navigate) + + def navigate_sign_accept(self, **kwargs) -> None: + """Navigate through signing flow and accept to sign""" + self.navigate_review(text=ScreenText.SIGN_ACCEPT, **kwargs) + + def sign(self, + account: Account, + message: Message, + with_hash: bool, + navigate: Optional[Callable] = None, + **kwargs) -> bytes: + """Send a sign request and navigate""" + if navigate is None: + def navigate(): + self.navigate_sign_accept(**kwargs) + return send_and_navigate( + send=lambda: self._backend.sign(account, message, with_hash), + navigate=navigate + ) + + def navigate_sign_reject(self, **kwargs) -> None: + """Navigate through signing flow and reject.""" + self.navigate_review(text=ScreenText.SIGN_REJECT, **kwargs) + + def reject_signing(self, + account: Account, + message: Message, + with_hash: bool, + **kwargs) -> None: + """Send a sign request and navigate in order to reject it""" + def navigate(): + self.navigate_sign_reject(**kwargs) + self.sign(account, message, with_hash, navigate)