Skip to content

Commit

Permalink
Remove ragger screenshots in tests with synthetic data
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspider committed Jun 19, 2024
1 parent 2cb995e commit 6ee586c
Show file tree
Hide file tree
Showing 167 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions tests/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def sign_psbt_instruction_tap(model: Firmware) -> Instructions:
if model.name.startswith("nano"):
return instructions

instructions.review_start()
instructions.review_start(save_screenshot=False)
return instructions


Expand All @@ -166,16 +166,16 @@ def sign_psbt_instruction_approve_opreturn(model: Firmware) -> Instructions:
return instructions


def sign_psbt_instruction_approve(model: Firmware) -> Instructions:
def sign_psbt_instruction_approve(model: Firmware, save_screenshot: bool = True) -> Instructions:
instructions = Instructions(model)

if model.name.startswith("nano"):
instructions.new_request("Continue")
instructions.same_request("Sign")
instructions.new_request("Continue", save_screenshot=save_screenshot)
instructions.same_request("Sign", save_screenshot=save_screenshot)
else:
instructions.review_start()
instructions.review_fees()
instructions.confirm_transaction()
instructions.review_start(save_screenshot=save_screenshot)
instructions.review_fees(save_screenshot=save_screenshot)
instructions.confirm_transaction(save_screenshot=save_screenshot)
return instructions


Expand Down Expand Up @@ -280,17 +280,17 @@ def sign_psbt_instruction_approve_8(model: Firmware) -> Instructions:
return instructions


def sign_psbt_instruction_approve_9(model: Firmware) -> Instructions:
def sign_psbt_instruction_approve_9(model: Firmware, save_screenshot: bool = True) -> Instructions:
instructions = Instructions(model)

if model.name.startswith("nano"):
instructions.new_request("Continue")
instructions.new_request("Continue")
instructions.same_request("Sign")
instructions.new_request("Continue", save_screenshot=save_screenshot)
instructions.new_request("Continue", save_screenshot=save_screenshot)
instructions.same_request("Sign", save_screenshot=save_screenshot)
else:
instructions.review_start(output_count=2)
instructions.review_fees()
instructions.confirm_transaction()
instructions.review_start(output_count=2, save_screenshot=save_screenshot)
instructions.review_fees(save_screenshot=save_screenshot)
instructions.confirm_transaction(save_screenshot=save_screenshot)
return instructions


Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
8 changes: 4 additions & 4 deletions tests/test_sign_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def test_sign_psbt_singlesig_wpkh_4to3(navigator: Navigator, firmware: Firmware,
assert sum_out < sum_in

result = client.sign_psbt(psbt, wallet, None, navigator,
instructions=sign_psbt_instruction_approve_9(firmware),
instructions=sign_psbt_instruction_approve_9(firmware, save_screenshot=False),
testname=test_name)

assert len(result) == n_ins
Expand Down Expand Up @@ -580,7 +580,7 @@ def test_sign_psbt_singlesig_large_amount(navigator: Navigator, firmware: Firmwa
assert sum_out < sum_in

result = client.sign_psbt(psbt, wallet, None, navigator,
instructions=sign_psbt_instruction_approve(firmware),
instructions=sign_psbt_instruction_approve(firmware, save_screenshot=False),
testname=test_name)

assert len(result) == 1
Expand Down Expand Up @@ -617,7 +617,7 @@ def test_sign_psbt_singlesig_wpkh_512to256(navigator: Navigator, firmware: Firmw
)

result = client.sign_psbt(psbt, wallet, None, navigator,
instructions=sign_psbt_instruction_approve(firmware),
instructions=sign_psbt_instruction_approve(firmware, save_screenshot=False),
testname=test_name)

assert len(result) == n_inputs
Expand Down Expand Up @@ -680,7 +680,7 @@ def test_sign_psbt_fail_wrong_non_witness_utxo(navigator: Navigator, firmware: F
client._no_clone_psbt = True
with pytest.raises(ExceptionRAPDU) as e:
client.sign_psbt(psbt, wallet, None, navigator,
instructions=sign_psbt_instruction_approve(firmware),
instructions=sign_psbt_instruction_approve(firmware, save_screenshot=False),
testname=test_name)
assert DeviceException.exc.get(e.value.status) == IncorrectDataError
assert len(e.value.data) == 0
Expand Down

0 comments on commit 6ee586c

Please sign in to comment.