mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-18 08:09:03 +00:00
test: Enable and tweak RBF device tests for T1.
This commit is contained in:
parent
389f14d6c4
commit
9ab4efdbad
@ -73,7 +73,6 @@ TXHASH_43d273 = bytes.fromhex(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
def test_p2pkh_fee_bump(client):
|
||||
inp1 = messages.TxInputType(
|
||||
address_n=parse_path("44h/0h/0h/0/4"),
|
||||
@ -100,6 +99,8 @@ def test_p2pkh_fee_bump(client):
|
||||
orig_index=1,
|
||||
)
|
||||
|
||||
tt = client.features.model == "T"
|
||||
|
||||
with client:
|
||||
client.set_expected_responses(
|
||||
[
|
||||
@ -116,9 +117,9 @@ def test_p2pkh_fee_bump(client):
|
||||
request_meta(TXHASH_beafc7),
|
||||
request_input(0, TXHASH_beafc7),
|
||||
request_output(0, TXHASH_beafc7),
|
||||
request_orig_input(0, TXHASH_50f6f1),
|
||||
request_orig_output(0, TXHASH_50f6f1),
|
||||
request_orig_output(1, TXHASH_50f6f1),
|
||||
(tt, request_orig_input(0, TXHASH_50f6f1)),
|
||||
(tt, request_orig_output(0, TXHASH_50f6f1)),
|
||||
(tt, request_orig_output(1, TXHASH_50f6f1)),
|
||||
request_input(0),
|
||||
request_output(0),
|
||||
request_output(1),
|
||||
@ -141,7 +142,6 @@ def test_p2pkh_fee_bump(client):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
def test_p2wpkh_finalize(client):
|
||||
# Original input with disabled RBF opt-in, i.e. we finalize the transaction.
|
||||
inp1 = messages.TxInputType(
|
||||
@ -302,42 +302,38 @@ def test_p2wpkh_payjoin(
|
||||
orig_index=1,
|
||||
)
|
||||
|
||||
responses = [
|
||||
resp
|
||||
for resp in [
|
||||
request_input(0),
|
||||
request_meta(TXHASH_65b768),
|
||||
request_orig_input(0, TXHASH_65b768),
|
||||
request_input(1),
|
||||
request_output(0),
|
||||
request_orig_output(0, TXHASH_65b768),
|
||||
request_output(1),
|
||||
request_orig_output(1, TXHASH_65b768),
|
||||
messages.ButtonRequest(code=B.SignTx),
|
||||
messages.ButtonRequest(code=B.SignTx) if fee_confirm else None,
|
||||
request_input(0),
|
||||
request_meta(TXHASH_e4b5b2),
|
||||
request_input(0, TXHASH_e4b5b2),
|
||||
request_output(0, TXHASH_e4b5b2),
|
||||
request_output(1, TXHASH_e4b5b2),
|
||||
request_input(1),
|
||||
request_meta(TXHASH_70f987),
|
||||
request_input(0, TXHASH_70f987),
|
||||
request_output(0, TXHASH_70f987),
|
||||
request_output(1, TXHASH_70f987),
|
||||
request_input(0),
|
||||
request_input(1),
|
||||
request_output(0),
|
||||
request_output(1),
|
||||
request_input(0),
|
||||
request_input(1),
|
||||
request_finished(),
|
||||
]
|
||||
if resp is not None
|
||||
]
|
||||
|
||||
with client:
|
||||
client.set_expected_responses(responses)
|
||||
client.set_expected_responses(
|
||||
[
|
||||
request_input(0),
|
||||
request_meta(TXHASH_65b768),
|
||||
request_orig_input(0, TXHASH_65b768),
|
||||
request_input(1),
|
||||
request_output(0),
|
||||
request_orig_output(0, TXHASH_65b768),
|
||||
request_output(1),
|
||||
request_orig_output(1, TXHASH_65b768),
|
||||
messages.ButtonRequest(code=B.SignTx),
|
||||
(fee_confirm, messages.ButtonRequest(code=B.SignTx)),
|
||||
request_input(0),
|
||||
request_meta(TXHASH_e4b5b2),
|
||||
request_input(0, TXHASH_e4b5b2),
|
||||
request_output(0, TXHASH_e4b5b2),
|
||||
request_output(1, TXHASH_e4b5b2),
|
||||
request_input(1),
|
||||
request_meta(TXHASH_70f987),
|
||||
request_input(0, TXHASH_70f987),
|
||||
request_output(0, TXHASH_70f987),
|
||||
request_output(1, TXHASH_70f987),
|
||||
request_input(0),
|
||||
request_input(1),
|
||||
request_output(0),
|
||||
request_output(1),
|
||||
request_input(0),
|
||||
request_input(1),
|
||||
request_finished(),
|
||||
]
|
||||
)
|
||||
_, serialized_tx = btc.sign_tx(
|
||||
client,
|
||||
"Testnet",
|
||||
@ -350,7 +346,6 @@ def test_p2wpkh_payjoin(
|
||||
assert serialized_tx.hex() == expected_tx
|
||||
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
def test_p2wpkh_in_p2sh_remove_change(client):
|
||||
# Test fee bump with change-output removal. Originally fee was 3780, now 98060.
|
||||
|
||||
@ -566,7 +561,6 @@ def test_tx_meld(client):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
@pytest.mark.skip_ui
|
||||
def test_attack_steal_change(client):
|
||||
# Attempt to steal amount equivalent to the change in the original transaction by
|
||||
@ -691,7 +685,6 @@ def test_attack_false_internal(client):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
@pytest.mark.skip_ui
|
||||
def test_attack_fake_int_input_amount(client):
|
||||
# Give a fake input amount for an original internal input while giving the correct
|
||||
|
Loading…
Reference in New Issue
Block a user