test(core/tron): add `yield` for cancellation input flow
What changed, and why it matters
This commit only changes a test file for the Tron cryptocurrency signing feature. It adds 'yield' statements to the test's simulated button-pressing sequence so the test properly waits between simulated user actions. There is no change to the actual Trezor firmware code that users run, and no security fix or vulnerability is present in the diff.
No security action needed. This is a test-only maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/device_tests/tron/test_sign_tx.py, adding yield statements inside two UI cancellation test helper generators (test_ui_cancel_flow and test_ui_cancel_unknown_contract). These yields allow the test framework to process asynchronous layout transitions between debug button presses (press_right/press_yes/press_no). No production firmware, cryptographic, or transaction-handling code is touched.
Changed components
tests/device_tests/tron/test_sign_tx.pyInspect captured patch +3 / −0
diff --git a/tests/device_tests/tron/test_sign_tx.py b/tests/device_tests/tron/test_sign_tx.py
index 1b74d64f..65b989b1 100644
--- a/tests/device_tests/tron/test_sign_tx.py
+++ b/tests/device_tests/tron/test_sign_tx.py
@@ -79,6 +79,7 @@ def test_ui_cancel_flow(session: Session, fixture: str):
session.debug.press_right()
else:
session.debug.press_yes()
+ yield
session.debug.press_no() # Wrong staking reason / wrong amount / wrong token
with pytest.raises(Cancelled), session.test_ctx as client:
@@ -98,7 +99,9 @@ def test_ui_cancel_unknown_contract(session: Session, fixture: str):
def ui_cancel_flow():
yield
session.debug.press_yes() # Accept warning
+ yield
session.debug.press_yes() # Accept contract address
+ yield
session.debug.press_no() # Data feels wrong
with pytest.raises(Cancelled), session.test_ctx as client:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.