From cbd3751bdbc08a86bcfa11acffaab02b9355dac3 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 23 Feb 2018 12:16:06 +0100 Subject: [PATCH] tests/device: allow multiple output changes (treat second as a normal output) based upon https://github.com/trezor/trezor-mcu/pull/306/commits/e716f7e84ecdb4732ad97b56e78d7407ec0b321e --- trezorlib/tests/device_tests/test_msg_signtx.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/trezorlib/tests/device_tests/test_msg_signtx.py b/trezorlib/tests/device_tests/test_msg_signtx.py index 378e503cf..56f7c7f3b 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx.py +++ b/trezorlib/tests/device_tests/test_msg_signtx.py @@ -777,13 +777,21 @@ class TestMsgSigntx(TrezorTest): proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput), proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=1)), proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=2)), + proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput), - # error should occur - proto.Failure(code=proto.FailureType.ProcessError, message='Only one change output is valid'), + proto.ButtonRequest(code=proto.ButtonRequestType.SignTx), + proto.TxRequest(request_type=proto.RequestType.TXINPUT, details=proto.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=1)), + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=2)), + + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=1)), + proto.TxRequest(request_type=proto.RequestType.TXOUTPUT, details=proto.TxRequestDetailsType(request_index=2)), + proto.TxRequest(request_type=proto.RequestType.TXFINISHED), ]) - with pytest.raises(CallException): - self.client.sign_tx('Testnet', [inp1, ], [out1, out_change1, out_change2]) + self.client.sign_tx('Testnet', [inp1, ], [out1, out_change1, out_change2]) def test_change_on_main_chain_allowed(self): self.setup_mnemonic_allallall()