Skip to content

Commit

Permalink
[test] remove unnecessary app.assert_screen(HOME) and app.quit()
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Nov 29, 2024
1 parent fc461f7 commit c78bbe7
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 161 deletions.
4 changes: 0 additions & 4 deletions tests/integration/nano/test_public_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,5 @@ def test_provide_pk(app: TezosAppScreen, account: Account, snapshot_dir: Path):
def test_reject_pk(app: TezosAppScreen, snapshot_dir: Path):
"""Check reject pk behaviour"""

app.assert_screen(Screen.HOME)

with StatusCode.REJECT.expected():
app.reject_public_key(DEFAULT_ACCOUNT, snap_path=snapshot_dir)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_ballot(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing ballot"""

app.assert_screen(Screen.HOME)

message = Ballot(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
proposal = 'ProtoALphaALphaALphaALphaALphaALphaALpha61322gcLUGH',
Expand All @@ -42,5 +40,3 @@ def test_sign_ballot(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def test_nanos_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

@requires_device("nanox")
def test_nanox_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing batch operation"""
Expand Down Expand Up @@ -108,12 +106,9 @@ def test_nanox_regression_batched_ops(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_sign_complex_operation(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing complex operation"""

app.assert_screen(Screen.HOME)
app.setup_expert_mode()

message = OperationGroup([
Expand Down Expand Up @@ -150,5 +145,3 @@ def test_sign_complex_operation(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_delegation(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing delegation"""

app.assert_screen(Screen.HOME)

message = Delegation(
source = 'tz2KC42yW9FXFMJpkUooae2NFYQsM5do3E8H',
fee = 200000,
Expand All @@ -44,5 +42,3 @@ def test_sign_delegation(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_failing_noop(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing failing noop"""

app.assert_screen(Screen.HOME)

message = FailingNoop("9f09f2952d34528c733f94615cfc39bc555619fc550dd4a67ba2208ce8e867aa3d13a6ef99dfbe32c6974aa9a2150d21eca29c3349e59c13b9081f1c11b440ac4d3455dedbe4ee0de15a8af620d4c86247d9d132de1bb6da23d5ff9d8dffda22ba9a84")

data = app.sign(DEFAULT_ACCOUNT,
Expand All @@ -37,5 +35,3 @@ def test_sign_failing_noop(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_increase_paid_storage(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing increase paid storage"""

app.assert_screen(Screen.HOME)

message = IncreasePaidStorage(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
fee = 10000,
Expand All @@ -45,5 +43,3 @@ def test_sign_increase_paid_storage(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ def test_sign_origination(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_proposals(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing proposals"""

app.assert_screen(Screen.HOME)

message = Proposals(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
proposals = [
Expand All @@ -44,5 +42,3 @@ def test_sign_proposals(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ def test_sign_register_global_constant(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_reveal(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing reveal"""

app.assert_screen(Screen.HOME)

message = Reveal(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
fee = 10000,
Expand All @@ -44,5 +42,3 @@ def test_sign_reveal(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_sc_rollup_add_messages(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing smart rollup add message"""

app.assert_screen(Screen.HOME)

message = ScRollupAddMessage(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
fee = 10000,
Expand All @@ -44,5 +42,3 @@ def test_sign_sc_rollup_add_messages(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ def test_sign_sc_rollup_execute_outbox_message(app: TezosAppScreen, snapshot_dir
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ def test_sign_sc_rollup_originate(app: TezosAppScreen, whitelist: Optional[List[
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_set_consensus_key(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing set consensus key"""

app.assert_screen(Screen.HOME)

message = UpdateConsensusKey(
source = 'tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E',
fee = 10000,
Expand All @@ -44,5 +42,3 @@ def test_sign_set_consensus_key(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
def test_sign_set_deposit_limit(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing set deposit limit"""

app.assert_screen(Screen.HOME)

message = SetDepositLimit(
source = 'tz3XeTwXXJeWNgVR3LqMcyBDdnxjbZ7TeEGH',
fee = 60000,
Expand All @@ -44,5 +42,3 @@ def test_sign_set_deposit_limit(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def test_sign_transaction(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_reject_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check reject transaction"""

Expand All @@ -74,8 +72,6 @@ def test_reject_transaction(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
snap_path=snapshot_dir)

app.quit()

def test_sign_simple_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign not complex transaction"""

Expand All @@ -101,13 +97,9 @@ def test_sign_simple_transaction(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_too_complex_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign complex transaction"""

app.assert_screen(Screen.HOME)

message = Transaction(
source = 'tz2JPgTWZZpxZZLqHMfS69UAy1UHm4Aw5iHu',
fee = 50000,
Expand All @@ -128,8 +120,6 @@ def test_too_complex_transaction(app: TezosAppScreen, snapshot_dir: Path):
navigate=lambda: app.navigate_review(text=ScreenText.BACK_HOME, snap_path=snapshot_dir)
)

app.quit()

def test_sign_stake_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign stake"""

Expand All @@ -156,8 +146,6 @@ def test_sign_stake_transaction(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_sign_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign unstake"""

Expand All @@ -184,8 +172,6 @@ def test_sign_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_sign_finalize_unstake_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign finalize_unstake"""

Expand All @@ -212,8 +198,6 @@ def test_sign_finalize_unstake_transaction(app: TezosAppScreen, snapshot_dir: Pa
with_hash=True,
data=data)

app.quit()

def test_sign_set_delegate_parameters_transaction(app: TezosAppScreen, snapshot_dir: Path):
"""Check sign set delegate parameters"""

Expand Down Expand Up @@ -249,8 +233,6 @@ def test_sign_set_delegate_parameters_transaction(app: TezosAppScreen, snapshot_
with_hash=True,
data=data)

app.quit()

def test_sign_with_long_hash(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing transaction with a long destination hash"""

Expand Down Expand Up @@ -278,8 +260,6 @@ def test_sign_with_long_hash(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

def test_ensure_always_clearsign(app: TezosAppScreen, snapshot_dir: Path):
"""Check clear signing never blindsign"""

Expand All @@ -306,5 +286,3 @@ def test_ensure_always_clearsign(app: TezosAppScreen, snapshot_dir: Path):
message=message,
with_hash=True,
data=data)

app.quit()
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def test_sign_transfer_ticket(app: TezosAppScreen, snapshot_dir: Path):
with_hash=True,
data=data)

app.quit()

@requires_device("nanosp")
def test_nanosp_regression_potential_empty_screen(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing operation that display potentially empty screens"""
Expand Down Expand Up @@ -81,5 +79,3 @@ def test_nanosp_regression_potential_empty_screen(app: TezosAppScreen, snapshot_
message=message,
with_hash=True,
data=data)

app.quit()
12 changes: 0 additions & 12 deletions tests/integration/nano/test_sign/test_apdu_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
def test_sign_micheline_without_hash(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing micheline wihout getting hash"""

app.assert_screen(Screen.HOME)

message = MichelineExpr([{'string': 'CACA'}, {'string': 'POPO'}, {'string': 'BOUDIN'}])

data = app.sign(DEFAULT_ACCOUNT,
Expand All @@ -40,8 +38,6 @@ def test_sign_micheline_without_hash(app: TezosAppScreen, snapshot_dir: Path):
with_hash=False,
data=data)

app.quit()

def test_sign_with_small_packet(app: TezosAppScreen, snapshot_dir: Path):
"""Check signing using small packet instead of full size packets"""

Expand All @@ -52,8 +48,6 @@ def check_sign_with_small_packet(
message: Message,
path: Path) -> None:

app.assert_screen(Screen.HOME)

data = send_and_navigate(
send=lambda: app.backend.sign(account, message, apdu_size=10),
navigate=lambda: app.navigate_review(text=ScreenText.SIGN_ACCEPT, snap_path=path)
Expand Down Expand Up @@ -81,14 +75,10 @@ def check_sign_with_small_packet(
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<E`SiG6Yf*A^kZ\\=7?H[mOlQ\n]Ehs'}]}]]]}]],[{'prim':'IF_NONE','args':[[{'prim':'DUP'}],[[{'prim':'DROP','args':[{'int':4}]},{'prim':'PUSH','args':[{'prim':'unit'},{'prim':'Unit'}]},{'prim':'PUSH','args':[{'prim':'bool'},{'prim':'True'}]},{'prim':'PUSH','args':[{'prim':'string'},{'string':'\"\\6_4\n$k%'}]},{'prim':'PUSH','args':[{'prim':'string'},{'string':'c^1\"\\?Ey_1!EVb~9;EX;YU\n#Kj2ZT8h`U!X '}]}]]]}]]},{'prim':'SIZE'}])

data = app.sign(DEFAULT_ACCOUNT,
Expand All @@ -100,5 +90,3 @@ def test_nanosp_regression_press_right_works_across_apdu_recieves(app: TezosAppS
message=message,
with_hash=True,
data=data)

app.quit()
Loading

0 comments on commit c78bbe7

Please sign in to comment.