Skip to content

Commit

Permalink
adapt doc images generation scripts to new structure
Browse files Browse the repository at this point in the history
fix typo on Dockerfile
  • Loading branch information
odudex committed Jul 5, 2024
1 parent 7a2e3ef commit 953aae8
Show file tree
Hide file tree
Showing 28 changed files with 122 additions and 138 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ RUN pip3 install pyserial==3.4

############
# build-software
# copy vendor, firmware and Kurx (src) files
# copy vendor, firmware and Krux (src) files
# install embit dependency
############
FROM build-base AS build-software
Expand Down
5 changes: 2 additions & 3 deletions simulator/generate-device-screenshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ poetry run python simulator.py --sequence sequences/home-options.txt --device $
poetry run python simulator.py --sequence sequences/encrypt-mnemonic.txt --sd --device $device
poetry run python simulator.py --sequence sequences/extended-public-key-wpkh.txt --device $device
poetry run python simulator.py --sequence sequences/extended-public-key-wsh.txt --device $device
poetry run python simulator.py --sequence sequences/wallet-wsh.txt --device $device
poetry run python simulator.py --sequence sequences/wallet-wpkh.txt --device $device
poetry run python simulator.py --sequence sequences/wallet-type-options.txt --device $device
poetry run python simulator.py --sequence sequences/wallet-descriptor-wsh.txt --device $device
poetry run python simulator.py --sequence sequences/wallet-descriptor-wpkh.txt --device $device
poetry run python simulator.py --sequence sequences/scan-address.txt --device $device
poetry run python simulator.py --sequence sequences/list-address.txt --device $device
poetry run python simulator.py --sequence sequences/sign-psbt.txt --sd --device $device
Expand Down
7 changes: 6 additions & 1 deletion simulator/kruxsim/mocks/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from cv2 import split, VideoCapture, cvtColor, COLOR_BGR2RGB, COLOR_BGR2LAB
from numpy import std
from PIL import Image
import time

THREAD_DROP_PERIOD = 0.01

sequence_executor = None

Expand Down Expand Up @@ -97,6 +100,9 @@ def find_qrcodes(img):


def snapshot():
# Temporarily yield execution to allow other threads to run
time.sleep(THREAD_DROP_PERIOD)

m = mock.MagicMock()
if sequence_executor:
if sequence_executor.camera_image is not None:
Expand Down Expand Up @@ -127,7 +133,6 @@ def snapshot():
m.get_statistics.return_value = MockStatistics(lab_frame)
m.width.return_value = frame.shape[1]
m.height.return_value = frame.shape[0]

return m


Expand Down
5 changes: 4 additions & 1 deletion simulator/kruxsim/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from kruxsim.mocks.board import BOARD_CONFIG

COMMANDS = ["press", "press_amigo_only", "touch", "qrcode", "screenshot", "wait", "include", "x"]
THREAD_PERIOD = 0.1
THREAD_PERIOD = 0.05


class SequenceExecutor:
Expand Down Expand Up @@ -78,6 +78,9 @@ def execute(self):
self.command_timer += float(params[0])
self.command_fn = self.wait

# Pause this thread to give other threads time to execute
time.sleep(THREAD_PERIOD)

def press_key(self):
key = self.command_params[0]
self.key = None
Expand Down
8 changes: 6 additions & 2 deletions simulator/sequences/all-settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ screenshot settings-options.png

# Navigate to Bitcoin
press BUTTON_A
press BUTTON_B
press BUTTON_A

screenshot network-options.png

# screenshot bitcoin-options-mainnet.png

# Return
press BUTTON_A
press BUTTON_B
press BUTTON_A

# Navigate to Encryption
press BUTTON_B
Expand Down Expand Up @@ -57,7 +61,7 @@ press_amigo_only BUTTON_C
press_amigo_only BUTTON_A

# Move to printer
press_amigo_only BUTTON_B
x2 press_amigo_only BUTTON_B
press_amigo_only BUTTON_A

screenshot printer-options.png
Expand Down Expand Up @@ -100,7 +104,7 @@ screenshot persist-options.png
press BUTTON_A

# Navigate to Appearance
press BUTTON_B
x2 press BUTTON_B
press BUTTON_A

screenshot settings-options-appearance.png
Expand Down
6 changes: 1 addition & 5 deletions simulator/sequences/amigo/_load-12-word-mnemonic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ wait 0.5
# Confirm words
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
6 changes: 1 addition & 5 deletions simulator/sequences/amigo/_load-12-word-mnemonic_b.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ wait 0.5
# Confirm words
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
6 changes: 1 addition & 5 deletions simulator/sequences/amigo/_load-24-word-mnemonic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ wait 0.5
# Confirm words
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
5 changes: 1 addition & 4 deletions simulator/sequences/extended-public-key-wpkh.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
include _load-12-word-mnemonic.txt
wait 1
press BUTTON_A
wait 1

# Navigate to Extended Public Key
x2 press BUTTON_B
press BUTTON_B
press BUTTON_A

screenshot extended-public-key-menu.png
Expand Down
7 changes: 3 additions & 4 deletions simulator/sequences/extended-public-key-wsh.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
include _load-12-word-mnemonic.txt

# Navigate to Extended Public Key
press BUTTON_B
press BUTTON_A
wait 1

# Navigate to Extended Public Key
x2 press BUTTON_B
x2 press BUTTON_A
press BUTTON_A

screenshot extended-public-key-wsh-xpub-text.png

Expand Down
38 changes: 19 additions & 19 deletions simulator/sequences/home-options.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
include _load-12-word-mnemonic_b.txt
press BUTTON_A
wait 1

screenshot home-options.png

# Mnemonic Backup options

press BUTTON_A

screenshot backup-options.png

press BUTTON_A
x3 press BUTTON_A

screenshot backup-mnemonic-words.png
screenshot backup-qr-plain-text.png

press BUTTON_A

# Re-enable Amigo's physical buttons
press_amigo_only BUTTON_B

press BUTTON_B
x2 press BUTTON_A
press BUTTON_A

screenshot backup-mnemonic-numbers.png
screenshot backup-compact-qr.png

press BUTTON_A
press BUTTON_C
press BUTTON_A
press BUTTON_B
press BUTTON_A

screenshot backup-qr-plain-text.png
screenshot backup-seed-qr.png

press BUTTON_A
press BUTTON_C
press BUTTON_A
x2 press BUTTON_B
press BUTTON_A

# Re-enable Amigo's physical buttons
press_amigo_only BUTTON_B
# Go to "Other" options

press BUTTON_B
press BUTTON_A
x2 press BUTTON_B
x2 press BUTTON_A

screenshot backup-compact-qr.png
screenshot backup-mnemonic-words.png

press BUTTON_A
press BUTTON_C
press BUTTON_A
press BUTTON_B
press BUTTON_A
x2 press BUTTON_A

screenshot backup-seed-qr.png
screenshot backup-mnemonic-numbers.png

press BUTTON_A
press BUTTON_C
Expand Down
4 changes: 1 addition & 3 deletions simulator/sequences/list-address.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
include _load-12-word-mnemonic.txt
press BUTTON_A
wait 1

# Navigate to Scan Address
x4 press BUTTON_B
x3 press BUTTON_B
press BUTTON_A

screenshot address-menu.png
Expand Down
12 changes: 3 additions & 9 deletions simulator/sequences/load-mnemonic-sequence.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ screenshot load-mnemonic-seq-mnemonic.png

press BUTTON_A

screenshot load-mnemonic-seq-passphrase.png
screenshot load-mnemonic-seq-overview.png

# No passphrase
press BUTTON_C
x2 press BUTTON_B
press BUTTON_A

screenshot load-mnemonic-seq-fingerprint.png

press BUTTON_A

wait 0.1
screenshot load-mnemonic-seq-single-multi.png

screenshot wallet-customization-options.png
6 changes: 1 addition & 5 deletions simulator/sequences/m5stickv/_load-12-word-mnemonic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ wait 0.5
# Confirm words
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
6 changes: 1 addition & 5 deletions simulator/sequences/m5stickv/_load-12-word-mnemonic_b.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ wait 0.5
# Confirm words
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
6 changes: 1 addition & 5 deletions simulator/sequences/m5stickv/_load-24-word-mnemonic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@ wait 0.5
press BUTTON_A
press BUTTON_A

# Don't add a passphrase
press BUTTON_C
press BUTTON_A

# Confirm fingerprint
# Confirm wallet
press BUTTON_A
4 changes: 2 additions & 2 deletions simulator/sequences/new-mnemonic-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ qrcode arara.png

screenshot new-mnemonic-via-snapshot-capturing.png

wait 0.5
wait 0.3

press BUTTON_A

Expand All @@ -36,7 +36,7 @@ press BUTTON_B
press_amigo_only BUTTON_A

# Move to D6
press BUTTON_B
x2 press BUTTON_B
press BUTTON_A

# 12 words - intro ok
Expand Down
12 changes: 7 additions & 5 deletions simulator/sequences/print-qr.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
include _load-12-word-mnemonic.txt
press BUTTON_A
wait 1

# Navigate to Mnemonic Words print promt
x3 press BUTTON_A
wait 1
# Navigate to Mnemonic Plain Text QR print promt
x5 press BUTTON_A
wait 0.1

screenshot print-qr-prompt.png

# Re-enable buttons on Amigo
press_amigo_only BUTTON_A

# Confirm print
press BUTTON_A

screenshot print-qr-printing.png
11 changes: 5 additions & 6 deletions simulator/sequences/scan-address.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
include _load-12-word-mnemonic.txt
press BUTTON_A
wait 1

# Navigate to Scan Address
x4 press BUTTON_B
x3 press BUTTON_B
x3 press BUTTON_A

qrcode specter-desktop-singlesig-wallet-receive-address.png
wait 0.5
wait 0.1

screenshot scan-address-scanned-address.png

press BUTTON_A

press BUTTON_A

wait 1
wait 0.1
# screenshot scan-address-valid-address.png

press BUTTON_A

press BUTTON_A

qrcode invalid-receive-address.png
wait 0.5
wait 0.1

press BUTTON_A

Expand All @@ -32,6 +30,7 @@ press BUTTON_A
# screenshot scan-address-searching.png

press BUTTON_B
press_amigo_only BUTTON_A

# screenshot scan-address-invalid-address.png

Expand Down
Loading

0 comments on commit 953aae8

Please sign in to comment.