feat(tests): cancel output flow on amount screen

[no changelog]
This commit is contained in:
Ioan Bizău
2026-01-09 11:40:05 +01:00
committed by Ioan Bizău
parent 554fa2c41b
commit cee2358126
2 changed files with 62 additions and 0 deletions

View File

@@ -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

View File

@@ -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)