feat(tests): cancel output flow on amount screen
What changed, and why it matters
This commit only adds a new automated test for the Trezor hardware wallet. The test checks that a user can cancel a Bitcoin transaction signing flow from the amount confirmation screen on newer device models. It does not change any firmware, wallet logic, or security behavior. There is no security issue here.
No action needed. This is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a test case test_one_one_fee_cancel_from_amount and a helper input-flow class InputFlowSignTxCancelFromAmount in the Trezor test suite. The test exercises the UI automation paths for Delizia and Eckhart models, verifying that pressing the menu button and selecting Cancel on the amount screen aborts the sign-transaction flow and raises Cancelled. It is purely test infrastructure and does not modify production code.
Changed components
tests/device_tests/bitcoin/test_signtx.pytests/input_flows.pyInspect captured patch +62 / −0
diff --git a/tests/device_tests/bitcoin/test_signtx.py b/tests/device_tests/bitcoin/test_signtx.py
index d97bd3ce..1350c3fd 100644
--- a/tests/device_tests/bitcoin/test_signtx.py
+++ b/tests/device_tests/bitcoin/test_signtx.py
@@ -28,6 +28,7 @@ from ...input_flows import (
InputFlowLockTimeBlockHeight,
InputFlowLockTimeDatetime,
InputFlowSignTxBackFromAmount,
+ InputFlowSignTxCancelFromAmount,
InputFlowSignTxHighFee,
InputFlowSignTxInformation,
InputFlowSignTxInformationCancel,
@@ -208,6 +209,32 @@ def test_one_one_fee_back_from_amount(session: Session):
)
+@pytest.mark.models(
+ "t3t1", "t3w1", reason="Cannot cancel from Amount screen on Bolt & Caesar"
+)
+def test_one_one_fee_cancel_from_amount(session: Session):
+ # input tx: 0dac366fd8a67b2a89fbb0d31086e7acded7a5bbf9ef9daa935bc873229ef5b5
+
+ inp1 = messages.TxInputType(
+ address_n=parse_path("m/44h/0h/5h/0/9"), # 1H2CRJBrDMhkvCGZMW7T4oQwYbL8eVuh7p
+ amount=63_988,
+ prev_hash=TXHASH_0dac36,
+ prev_index=0,
+ )
+
+ out1 = messages.TxOutputType(
+ address="13Hbso8zgV5Wmqn3uA7h3QVtmPzs47wcJ7",
+ amount=50_248,
+ script_type=messages.OutputScriptType.PAYTOADDRESS,
+ )
+
+ with session.client as client, pytest.raises(Cancelled):
+ IF = InputFlowSignTxCancelFromAmount(session.client)
+ client.set_input_flow(IF.get())
+
+ btc.sign_tx(session, "Bitcoin", [inp1], [out1], prev_txes=TX_CACHE_MAINNET)
+
+
def test_testnet_one_two_fee(session: Session):
# input tx: e5040e1bc1ae7667ffb9e5248e90b2fb93cd9150234151ce90e14ab2f5933bcd
diff --git a/tests/input_flows.py b/tests/input_flows.py
index 740ea82c..4050b15e 100644
--- a/tests/input_flows.py
+++ b/tests/input_flows.py
@@ -1228,6 +1228,41 @@ class InputFlowSignTxBackFromAmount(InputFlowBase):
self.debug.press_yes()
+class InputFlowSignTxCancelFromAmount(InputFlowBase):
+ def __init__(self, client: Client):
+ super().__init__(client)
+
+ def input_flow_delizia(self) -> BRGeneratorType:
+ yield # confirm address
+ layout = self.debug.read_layout()
+ assert TR.words__address in layout.title()
+ assert TR.words__recipient + " #1" in layout.title()
+ self.debug.swipe_up()
+
+ yield # amount screen
+ layout = self.debug.read_layout()
+ assert TR.words__amount in layout.title()
+ assert TR.words__recipient + " #1" in layout.title()
+
+ self.debug.click(self.debug.screen_buttons.menu())
+ self.debug.button_actions.navigate_to_menu_item(1) # click Cancel
+ self.debug.synchronize_at("PromptScreen")
+ self.debug.click(self.debug.screen_buttons.tap_to_confirm())
+
+ def input_flow_eckhart(self) -> BRGeneratorType:
+ yield # confirm address
+ self.debug.read_layout()
+ self.debug.click(self.debug.screen_buttons.ok())
+
+ yield # amount screen
+ self.debug.read_layout()
+
+ self.debug.click(self.debug.screen_buttons.menu())
+ self.debug.button_actions.navigate_to_menu_item(1) # click Cancel
+ self.debug.synchronize_at("TextScreen")
+ self.debug.click(self.debug.screen_buttons.ok())
+
+
class InputFlowSignTxInformation(InputFlowBase):
def __init__(self, client: Client):
super().__init__(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.