-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] add test to check that expert screen is displayed once
- Loading branch information
Showing
93 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+395 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+422 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+481 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+482 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+311 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+359 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+323 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+391 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+499 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+396 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+402 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+454 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+481 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+482 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+311 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+362 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+338 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+328 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+463 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+478 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+287 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+498 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+494 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+366 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+404 Bytes
tests/integration/nano/snapshots/nanos/test_sign_complex_operation/00024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+463 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00000.png
Oops, something went wrong.
Binary file added
BIN
+455 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00001.png
Oops, something went wrong.
Binary file added
BIN
+728 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00002.png
Oops, something went wrong.
Binary file added
BIN
+331 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00003.png
Oops, something went wrong.
Binary file added
BIN
+387 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00004.png
Oops, something went wrong.
Binary file added
BIN
+343 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00005.png
Oops, something went wrong.
Binary file added
BIN
+423 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00006.png
Oops, something went wrong.
Binary file added
BIN
+542 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00007.png
Oops, something went wrong.
Binary file added
BIN
+423 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00008.png
Oops, something went wrong.
Binary file added
BIN
+435 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00009.png
Oops, something went wrong.
Binary file added
BIN
+489 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00010.png
Oops, something went wrong.
Binary file added
BIN
+728 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00011.png
Oops, something went wrong.
Binary file added
BIN
+330 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00012.png
Oops, something went wrong.
Binary file added
BIN
+385 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00013.png
Oops, something went wrong.
Binary file added
BIN
+358 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00014.png
Oops, something went wrong.
Binary file added
BIN
+360 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00015.png
Oops, something went wrong.
Binary file added
BIN
+716 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00016.png
Oops, something went wrong.
Binary file added
BIN
+307 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00017.png
Oops, something went wrong.
Binary file added
BIN
+720 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00018.png
Oops, something went wrong.
Binary file added
BIN
+402 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00019.png
Oops, something went wrong.
Binary file added
BIN
+459 Bytes
tests/integration/nano/snapshots/nanosp/test_sign_complex_operation/00020.png
Oops, something went wrong.
Binary file added
BIN
+463 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00000.png
Oops, something went wrong.
Binary file added
BIN
+455 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00001.png
Oops, something went wrong.
Binary file added
BIN
+728 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00002.png
Oops, something went wrong.
Binary file added
BIN
+331 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00003.png
Oops, something went wrong.
Binary file added
BIN
+387 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00004.png
Oops, something went wrong.
Binary file added
BIN
+343 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00005.png
Oops, something went wrong.
Binary file added
BIN
+423 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00006.png
Oops, something went wrong.
Binary file added
BIN
+542 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00007.png
Oops, something went wrong.
Binary file added
BIN
+423 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00008.png
Oops, something went wrong.
Binary file added
BIN
+435 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00009.png
Oops, something went wrong.
Binary file added
BIN
+489 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00010.png
Oops, something went wrong.
Binary file added
BIN
+728 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00011.png
Oops, something went wrong.
Binary file added
BIN
+330 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00012.png
Oops, something went wrong.
Binary file added
BIN
+385 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00013.png
Oops, something went wrong.
Binary file added
BIN
+358 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00014.png
Oops, something went wrong.
Binary file added
BIN
+360 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00015.png
Oops, something went wrong.
Binary file added
BIN
+716 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00016.png
Oops, something went wrong.
Binary file added
BIN
+307 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00017.png
Oops, something went wrong.
Binary file added
BIN
+720 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00018.png
Oops, something went wrong.
Binary file added
BIN
+402 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00019.png
Oops, something went wrong.
Binary file added
BIN
+459 Bytes
tests/integration/nano/snapshots/nanox/test_sign_complex_operation/00020.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2024 Functori <[email protected]> | ||
|
||
# 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. | ||
|
||
from pathlib import Path | ||
|
||
from utils.app import Screen, Screen_text, DEFAULT_ACCOUNT | ||
from utils.backend import StatusCode | ||
from utils.message import Message | ||
|
||
# Operation (0): Transaction | ||
# Fee: 0.05 XTZ | ||
# Storage limit: 45 | ||
# Amount: 0.24 XTZ | ||
# Destination: KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT | ||
# Entrypoint: do | ||
# Parameter: CAR | ||
|
||
## Operation (0): Origination | ||
# Source: tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa | ||
# Fee: 0.5 XTZ | ||
# Storage limit: 4 | ||
# Balance: 1 XTZ | ||
# Delegate: None | ||
# Code: UNPACK mutez | ||
# Storage: or key chest | ||
## Operation (1): Transfer ticket | ||
# Source: tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa | ||
# Fee: 0.01 XTZ | ||
# Storage limit: 5 | ||
# Contents: None | ||
# Type: option nat | ||
# Ticketer: tz1TmFPVZsGQ8MnrBJtnECJgkFUwLa6EWYDm | ||
# Amount: 7 | ||
# Destination: tz3eydffbLkjdVb8zx42BvxpGV87zaRnqL3r | ||
# Entrypoint: default | ||
|
||
def test_sign_complex_operation(app): | ||
test_name = Path(__file__).stem | ||
|
||
app.assert_screen(Screen.Home) | ||
app.setup_expert_mode() | ||
|
||
message = Message.from_bytes("0300000000000000000000000000000000000000000000000000000000000000006d00ffdd6102321bc251e4a5190ad5b12b251069d9b4a0c21e040304c0843d0000000004050d036a000000060764035c038d9e00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e05040500000002030600000004056303620000591e842444265757d6a65e3670ca18b5e662f9c0070002cc8e146741cf31fc00123b8c26baf95c57421a3c0000000764656661756c74") | ||
|
||
data = app.sign(DEFAULT_ACCOUNT, | ||
message, | ||
with_hash=True, | ||
path=test_name) | ||
|
||
app.checker.check_signature( | ||
account=DEFAULT_ACCOUNT, | ||
message=message, | ||
with_hash=True, | ||
data=data) | ||
|
||
app.quit() |
Binary file added
BIN
+13.5 KB
...gration/touch/snapshots/flex/test_sign_complex_operation/enable_expert_mode.png
Oops, something went wrong.
Binary file added
BIN
+6.89 KB
...ration/touch/snapshots/flex/test_sign_complex_operation/enabled_expert_mode.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
...gration/touch/snapshots/flex/test_sign_complex_operation/expert_mode_splash.png
Oops, something went wrong.
Binary file added
BIN
+8.55 KB
...integration/touch/snapshots/flex/test_sign_complex_operation/operation_sign.png
Oops, something went wrong.
Binary file added
BIN
+18.2 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_01.png
Oops, something went wrong.
Binary file added
BIN
+8.09 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_02.png
Oops, something went wrong.
Binary file added
BIN
+17.7 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_03.png
Oops, something went wrong.
Binary file added
BIN
+13.4 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_04.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_05.png
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_06.png
Oops, something went wrong.
Binary file added
BIN
+9.81 KB
...ch/snapshots/flex/test_sign_complex_operation/review_request_sign_operation.png
Oops, something went wrong.
Binary file added
BIN
+6.21 KB
...gration/touch/snapshots/flex/test_sign_complex_operation/signing_successful.png
Oops, something went wrong.
Binary file added
BIN
+12.3 KB
...gration/touch/snapshots/stax/test_sign_complex_operation/enable_expert_mode.png
Oops, something went wrong.
Binary file added
BIN
+6.62 KB
...ration/touch/snapshots/stax/test_sign_complex_operation/enabled_expert_mode.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...gration/touch/snapshots/stax/test_sign_complex_operation/expert_mode_splash.png
Oops, something went wrong.
Binary file added
BIN
+7.95 KB
...integration/touch/snapshots/stax/test_sign_complex_operation/operation_sign.png
Oops, something went wrong.
Binary file added
BIN
+16.2 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_01.png
Oops, something went wrong.
Binary file added
BIN
+7.4 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_02.png
Oops, something went wrong.
Binary file added
BIN
+16 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_03.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_04.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_05.png
Oops, something went wrong.
Binary file added
BIN
+9.51 KB
tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_06.png
Oops, something went wrong.
Binary file added
BIN
+9.24 KB
...ch/snapshots/stax/test_sign_complex_operation/review_request_sign_operation.png
Oops, something went wrong.
Binary file added
BIN
+6.07 KB
...gration/touch/snapshots/stax/test_sign_complex_operation/signing_successful.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2023 Trilitech <[email protected]> | ||
|
||
# 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. | ||
|
||
from utils import ( | ||
tezos_app, | ||
send_initialize_msg, | ||
send_payload, | ||
index_screen | ||
) | ||
|
||
## Operation (0): Origination | ||
# Source: tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa | ||
# Fee: 0.5 XTZ | ||
# Storage limit: 4 | ||
# Balance: 1 XTZ | ||
# Delegate: None | ||
# Code: UNPACK mutez | ||
# Storage: or key chest | ||
## Operation (1): Transfer ticket | ||
# Source: tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa | ||
# Fee: 0.01 XTZ | ||
# Storage limit: 5 | ||
# Contents: None | ||
# Type: option nat | ||
# Ticketer: tz1TmFPVZsGQ8MnrBJtnECJgkFUwLa6EWYDm | ||
# Amount: 7 | ||
# Destination: tz3eydffbLkjdVb8zx42BvxpGV87zaRnqL3r | ||
# Entrypoint: default | ||
|
||
if __name__ == "__main__": | ||
app = tezos_app(__file__) | ||
|
||
app.assert_home() | ||
|
||
send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") | ||
send_payload(app, "800f81ffb40300000000000000000000000000000000000000000000000000000000000000006d00ffdd6102321bc251e4a5190ad5b12b251069d9b4a0c21e040304c0843d0000000004050d036a000000060764035c038d9e00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e05040500000002030600000004056303620000591e842444265757d6a65e3670ca18b5e662f9c0070002cc8e146741cf31fc00123b8c26baf95c57421a3c0000000764656661756c74") | ||
|
||
screen = "review" | ||
nb_screen = 2 | ||
|
||
for index in range(1, nb_screen+1): | ||
app.review.next() | ||
app.assert_screen(index_screen(screen, index)) | ||
|
||
app.review.next() | ||
app.expert_mode_splash() | ||
|
||
nb_screen_after = 4 | ||
|
||
for index_after in range(index+1, index+nb_screen_after+1): | ||
app.review.next() | ||
app.assert_screen(index_screen(screen, index_after)) | ||
|
||
app.review.next() | ||
app.assert_screen("operation_sign") | ||
|
||
expected_apdu = "5b8e95ffef018702781bef9aa935e05a879b79fa82f11d9cf067281144bb700237b3bcf1cd8222cbb9868341eabe58eddd212ed57c949cde5900444056a62cf049e61ff5acfe18a15166941810d283b52ff0a5b53b24416acb0f71643c925a0d9000" | ||
app.review_confirm_signing(expected_apdu) | ||
|
||
app.assert_home() | ||
app.quit() |