|
|
|
@ -19,10 +19,10 @@ import pytest
|
|
|
|
|
from trezorlib import btc, messages
|
|
|
|
|
from trezorlib.tools import H_, parse_path
|
|
|
|
|
|
|
|
|
|
from .. import bip32
|
|
|
|
|
from ..common import MNEMONIC12
|
|
|
|
|
from ..tx_cache import TxCache
|
|
|
|
|
from .signtx import request_finished, request_input, request_meta, request_output
|
|
|
|
|
from ... import bip32
|
|
|
|
|
from ...common import MNEMONIC12
|
|
|
|
|
from ...tx_cache import TxCache
|
|
|
|
|
from ..signtx import request_finished, request_input, request_meta, request_output
|
|
|
|
|
|
|
|
|
|
B = messages.ButtonRequestType
|
|
|
|
|
TX_API = TxCache("Testnet")
|
|
|
|
@ -136,6 +136,7 @@ INP3 = messages.TxInputType(
|
|
|
|
|
multisig=multisig_in3,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _responses(INP1, INP2, change=0):
|
|
|
|
|
resp = [
|
|
|
|
|
request_input(0),
|
|
|
|
@ -219,9 +220,7 @@ def test_external_internal(client):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
with client:
|
|
|
|
|
client.set_expected_responses(
|
|
|
|
|
_responses(INP1, INP2, change=2)
|
|
|
|
|
)
|
|
|
|
|
client.set_expected_responses(_responses(INP1, INP2, change=2))
|
|
|
|
|
_, serialized_tx = btc.sign_tx(
|
|
|
|
|
client,
|
|
|
|
|
"Bitcoin",
|
|
|
|
@ -251,9 +250,7 @@ def test_internal_external(client):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
with client:
|
|
|
|
|
client.set_expected_responses(
|
|
|
|
|
_responses(INP1, INP2, change=1)
|
|
|
|
|
)
|
|
|
|
|
client.set_expected_responses(_responses(INP1, INP2, change=1))
|
|
|
|
|
_, serialized_tx = btc.sign_tx(
|
|
|
|
|
client,
|
|
|
|
|
"Bitcoin",
|
|
|
|
@ -321,9 +318,7 @@ def test_multisig_change_match_first(client):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
with client:
|
|
|
|
|
client.set_expected_responses(
|
|
|
|
|
_responses(INP1, INP2, change=1)
|
|
|
|
|
)
|
|
|
|
|
client.set_expected_responses(_responses(INP1, INP2, change=1))
|
|
|
|
|
_, serialized_tx = btc.sign_tx(
|
|
|
|
|
client,
|
|
|
|
|
"Bitcoin",
|
|
|
|
@ -361,9 +356,7 @@ def test_multisig_change_match_second(client):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
with client:
|
|
|
|
|
client.set_expected_responses(
|
|
|
|
|
_responses(INP1, INP2, change=2)
|
|
|
|
|
)
|
|
|
|
|
client.set_expected_responses(_responses(INP1, INP2, change=2))
|
|
|
|
|
_, serialized_tx = btc.sign_tx(
|
|
|
|
|
client,
|
|
|
|
|
"Bitcoin",
|