From 51b9d4e177a37be5c9830ef4f755a9ae21d54b44 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 25 Mar 2014 19:36:46 +0100 Subject: [PATCH] recompile pb, adjust TransactionType constructors --- tests/test_msg_signtx.py | 161 +++++++++++++++++++++++++ tests/test_msg_simplesigntx.py | 200 ++------------------------------ tests/test_protection_levels.py | 2 +- trezorlib/api_blockchain.py | 2 +- trezorlib/messages_pb2.py | 175 ++++++++++++---------------- trezorlib/types_pb2.py | 47 +++++--- 6 files changed, 275 insertions(+), 312 deletions(-) create mode 100644 tests/test_msg_signtx.py diff --git a/tests/test_msg_signtx.py b/tests/test_msg_signtx.py new file mode 100644 index 0000000000..56c9410869 --- /dev/null +++ b/tests/test_msg_signtx.py @@ -0,0 +1,161 @@ +''' + def test_signtx(self): + expected_tx = '01000000012de70f7d6ffed0db70f8882f3fca90db9bb09f0e99bce27468c23d3c994fcd56' \ + '010000008b4830450221009b985e14d53cfeed3496846db6ddaa77a0206138d0df4c2ccd3b' \ + '759e91bae3e1022004c76e10f99ccac8ced761719181a96bae25a74829eab3ecb8f29eb07f' \ + 'e18f7e01410436ae8595f03a7324d1d1482ede8560a4508c767fbc662559482d5759b32209' \ + 'a62964699995f6e018cfbeb7a71a66d4c64fa38875d79ead0a9ac66f59c1c8b3a3ffffffff' \ + '0250c30000000000001976a91444ce5c6789b0bb0e8a9ab9a4769fe181cb274c4688aca086' \ + '0100000000001976a9149e03078026388661b197129a43f0f64f88379ce688ac00000000' + + inp1 = proto.TxInput(index=0, + address_n=[1, 0], + amount=200000, # 0.002 BTC + prev_hash=binascii.unhexlify('56cd4f993c3dc26874e2bc990e9fb09bdb90ca3f2f88f870dbd0fe6f7d0fe72d'), + prev_index=1, + #script_sig= + ) + + out1 = proto.TxOutput(index=0, + address='1GnnT11aZeH6QZCtT7EjCvRF3EXHoY3owE', + address_n=[0, 1], + amount=50000, # 0.0005 BTC + script_type=proto.PAYTOADDRESS, + #script_args= + ) + + out2 = proto.TxOutput(index=1, + address='1FQVPnjrbkPWeA8poUoEnX9U3n9DyhAVtv', + #address_n=[], + amount=100000, # 0.001 BTC + script_type=proto.PAYTOADDRESS, + #script_args= + ) + + print binascii.hexlify(self.client.sign_tx([inp1], [out1, out2])[1]) + ''' + ''' + def test_workflow(self): + inp1 = proto.TxInput(index=0, + address_n=[1,0], + amount=100000000, + prev_hash='prevhash1234354346543456543654', + prev_index=11, + ) + + inp2 = proto.TxInput(index=1, + address_n=[2,0], + amount=100000000, + prev_hash='prevhash2222254346543456543654', + prev_index=11, + ) + + out1 = proto.TxOutput(index=0, + address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx', + amount=100000000, + script_type=proto.PAYTOADDRESS, + ) + + out2 = proto.TxOutput(index=1, + address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx', + #address_n=[], + amount=100000000, + script_type=proto.PAYTOADDRESS, + #script_args= + ) + + serialized = '' + + # Prepare and send initial message + tx = proto.SignTx() + tx.algo = proto.ELECTRUM + tx.random = self.client._get_local_entropy() + tx.inputs_count = 2 + tx.outputs_count = 2 + + res = self.client.call(tx) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXINPUT) + self.assertEqual(res.request_index, 0) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + # FIRST SIGNATURE + res = self.client.call(inp1) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXINPUT) + self.assertEqual(res.request_index, 1) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(inp2) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 0) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(out1) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 1) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(out2) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXINPUT) + self.assertEqual(res.request_index, 0) + self.assertNotEqual(res.signature, '') + self.assertNotEqual(res.serialized_tx, '') + serialized += res.serialized_tx + + # SECOND SIGNATURE + res = self.client.call(inp1) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXINPUT) + self.assertEqual(res.request_index, 1) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(inp2) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 0) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(out1) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 1) + self.assertEqual(res.signature, '') + self.assertEqual(res.serialized_tx, '') + + res = self.client.call(out2) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 0) + self.assertNotEqual(res.signature, '') + self.assertNotEqual(res.serialized_tx, '') + serialized += res.serialized_tx + + # FINALIZING OUTPUTS + res = self.client.call(out1) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, 1) + self.assertEqual(res.signature, '') + self.assertNotEqual(res.serialized_tx, '') + serialized += res.serialized_tx + + res = self.client.call(out2) + self.assertIsInstance(res, proto.TxRequest) + self.assertEqual(res.request_type, proto.TXOUTPUT) + self.assertEqual(res.request_index, -1) + self.assertEqual(res.signature, '') + self.assertNotEqual(res.serialized_tx, '') + serialized += res.serialized_tx + + print binascii.hexlify(serialized) +''' diff --git a/tests/test_msg_simplesigntx.py b/tests/test_msg_simplesigntx.py index 822cadc38e..d8b906cfbe 100644 --- a/tests/test_msg_simplesigntx.py +++ b/tests/test_msg_simplesigntx.py @@ -14,7 +14,7 @@ class FakeTestnetBlockchain(object): if txhash != '6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54': raise Exception("Unexpected hash") - t = proto_types.TransactionType() + t = proto_types.TransactionType(version = 1, lock_time = 0) i = t.inputs.add() i.prev_hash = binascii.unhexlify('ee336e79153d51f4f3e45278f1f77ab29fd5bb135dce467282e2aff22cb9c570') @@ -59,7 +59,7 @@ class TestMsgSimplesigntx(common.TrezorTest): msg = self.client._prepare_simple_sign_tx('Bitcoin', [inp1, ], [out1, ]) self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest(request_index=-1)]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) # Accepted by network: tx fd79435246dee76b2f159d2db08032d666c95adc544de64c8c49f474df4a7fee @@ -92,7 +92,7 @@ class TestMsgSimplesigntx(common.TrezorTest): self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # don't confirm change proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '0100000001549d2977998f899a63c0a9da30dedb2841e33fef561097b05822eccbc7f3906f010000006b4830450221009c2d30385519fdb13dce13d5ac038be07d7b2dad0b0f7b2c1c339d7255bcf553022056a2f5bceab3cd0ffed4d388387e631f419d67ff9ce7798e3d7dfe6a6d6ec4bd0121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff0280ce341d000000001976a9140223b1a09138753c9cb0baf95a0a62c82711567a88ac0065cd1d000000001976a9142db345c36563122e2fd0f5485fb7ea9bbf7cb5a288ac00000000') @@ -125,7 +125,7 @@ class TestMsgSimplesigntx(common.TrezorTest): # proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # don't confirm change proto.ButtonRequest(code=proto_types.ButtonRequest_FeeOverThreshold), proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '0100000001549d2977998f899a63c0a9da30dedb2841e33fef561097b05822eccbc7f3906f010000006b483045022100d74e9fa5c7ff5966d52bce8d1d772c1e3ef1376395fb85a0bbf910e723bd606d02204cb8df6debd7c4c076632011bb1e180495bcf3630d2471c354bed56c2e45a2180121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff0200389c1c000000001976a9140223b1a09138753c9cb0baf95a0a62c82711567a88ac0065cd1d000000001976a9142db345c36563122e2fd0f5485fb7ea9bbf7cb5a288ac00000000') @@ -157,7 +157,7 @@ class TestMsgSimplesigntx(common.TrezorTest): self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # don't confirm change proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '010000000182488650ef25a58fef6788bd71b8212038d7f2bbe4750bc7bcb44701e85ef6d5000000006b483045022100c1400d8485d3bdcae7413e123148f35ece84806fc387ab88c66b469df89aef1702201d481d04216b319dc549ffe2333143629ba18828a4e2d1783ab719a6aa263eb70121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff02e0930400000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac80380100000000001976a9140223b1a09138753c9cb0baf95a0a62c82711567a88ac00000000') @@ -195,7 +195,7 @@ class TestMsgSimplesigntx(common.TrezorTest): proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # don't confirm change proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '010000000182488650ef25a58fef6788bd71b8212038d7f2bbe4750bc7bcb44701e85ef6d5000000006b483045022100e695e2c530c7c0fc32e6b79b7cff56a7f70a8c9da787534f46b4204070f914fc02207b0879a81408a11e23b11d4c7965c62b5fc6d5c2d92340f5ee2da7b40e99314a0121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff0300650400000000001976a914de9b2a8da088824e8fe51debea566617d851537888ace02e0000000000001976a9141fe1d337fb81afca42818051e12fd18245d1b17288ac80380100000000001976a9140223b1a09138753c9cb0baf95a0a62c82711567a88ac00000000') @@ -235,7 +235,7 @@ class TestMsgSimplesigntx(common.TrezorTest): self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), # don't confirm change proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) # Accepted by network: tx c63e24ed820c5851b60c54613fbc4bcb37df6cd49b4c96143e99580a472f79fb @@ -276,7 +276,7 @@ class TestMsgSimplesigntx(common.TrezorTest): msg = self.client._prepare_simple_sign_tx('Bitcoin', [inp1, inp2], outputs) self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), ] * 255 + \ [proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest(), ]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '0100000002fb792f470a58993e14964c9bd46cdf37cb4bbc3f61540cb651580c82ed243ec6010000006b483045022100969da46f94a81f34f3717b014e0c3e1826eda1b0022ec2f9ce39f3d750ab9235022026da269770993211a1503413566a339bbb4389a482fffcf8e1f76713fc3b94f5012103477b9f0f34ae85434ce795f0c5e1e90c9420e5b5fad084d7cce9a487b94a7902ffffffffe56582d2119100cb1d3da8232291e053f71e25fb669c87b32a667749959ea239010000006a473044022052e1419bb237b9db400ab5e3df16db6355619d545fde9030924a360763ae9ad40220704beab04d72ecaeb42eca7d98faca7a0941e65f2e1341f183be2b83e6b09e1c012103477b9f0f34ae85434ce795f0c5e1e90c9420e5b5fad084d7cce9a487b94a7902fffffffffdff00d8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088acd8270000000000001976a914f0a2b64e56ee2ff57126232f84af6e3a41d4055088ac00000000') @@ -304,7 +304,7 @@ class TestMsgSimplesigntx(common.TrezorTest): self.client.set_expected_responses([proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), proto.ButtonRequest(code=proto_types.ButtonRequest_FeeOverThreshold), proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest()]) + proto.TxRequest(finished=True)]) tx = self.client.call(msg) self.assertEqual(binascii.hexlify(tx.serialized_tx), '010000000182488650ef25a58fef6788bd71b8212038d7f2bbe4750bc7bcb44701e85ef6d5000000006a4730440220361b8268718533055682f4532d30c553ce778f70b217457a9aa1956e457c5aac0220538ae285bb340484bb09a67635d29192a14e61d8a8385b8b090a92e3e97e1c010121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff0120300500000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac00000000') @@ -338,187 +338,5 @@ class TestMsgSimplesigntx(common.TrezorTest): else: self.assert_(False, "types.Failure_NotEnoughFunds expected") - ''' - def test_simplesigntx_testnet(self): - self.client.load_device_by_xprv('xprv9s21ZrQH143K3zttRjiQmYwyugvd13pnd2VzefWrfSouRfnj5oSkJgBQXxtn18E9mqrDop7fQ8Xnb9JCLPE4vghzhpU4dT33ZJ7frjzTEW8', - '', False, 'testnet') - - inp1 = proto_types.TxInputType(address_n=[6], # mo8uUSFJULCMA4neRS9aS9jiXZ1N72FSLK - # amount=390000, - prev_hash=binascii.unhexlify('d83b27f16ce5069e0c8e4a02813f252500e257744d5b00c9b6128be7189117b1'), - prev_index=0, - ) - - out1 = proto_types.TxOutputType(address='mjKKH3Dk95VMbdNnDQYHZXoQ9QwuCZocwb', - amount=80085000, - script_type=proto_types.PAYTOADDRESS, - ) - - rawtx = {'d83b27f16ce5069e0c8e4a02813f252500e257744d5b00c9b6128be7189117b1': '01000000013b21cc65080c57793d0e47045a24d8e92262dc47efdc425fd5cad9a25e928f6c000000006b483045022100bde591f2c997bafa8388916663b148f4093914851a33a9903da69ad97afa6f470220138c6ff11321339974bac9c0992d7b9d72aef0c2d098f26267ec9f05d532c859012103edcc8dc5cac7dca6ed191d812621fb300863fea0dd5d14180b482b917a35acc4ffffffff020800c604000000001976a91453958011070469e2ef5e1115f34f509717d6884288acf8c99502000000001976a9141e2ba9407a6920246d0f345beecb89ed47c99a7788ac00000000'} - tx = self.client.simple_sign_tx('Testnet', [inp1, ], [out1, ]) - print binascii.hexlify(tx.serialized_tx) - self.assertEqual(binascii.hexlify(tx.serialized_tx), '010000000182488650ef25a58fef6788bd71b8212038d7f2bbe4750bc7bcb44701e85ef6d5000000006b4830450221009a0b7be0d4ed3146ee262b42202841834698bb3ee39c24e7437df208b8b7077102202b79ab1e7736219387dffe8d615bbdba87e11477104b867ef47afed1a5ede7810121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43dffffffff0160cc0500000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac00000000') - - def test_signtx(self): - expected_tx = '01000000012de70f7d6ffed0db70f8882f3fca90db9bb09f0e99bce27468c23d3c994fcd56' \ - '010000008b4830450221009b985e14d53cfeed3496846db6ddaa77a0206138d0df4c2ccd3b' \ - '759e91bae3e1022004c76e10f99ccac8ced761719181a96bae25a74829eab3ecb8f29eb07f' \ - 'e18f7e01410436ae8595f03a7324d1d1482ede8560a4508c767fbc662559482d5759b32209' \ - 'a62964699995f6e018cfbeb7a71a66d4c64fa38875d79ead0a9ac66f59c1c8b3a3ffffffff' \ - '0250c30000000000001976a91444ce5c6789b0bb0e8a9ab9a4769fe181cb274c4688aca086' \ - '0100000000001976a9149e03078026388661b197129a43f0f64f88379ce688ac00000000' - - inp1 = proto.TxInput(index=0, - address_n=[1, 0], - amount=200000, # 0.002 BTC - prev_hash=binascii.unhexlify('56cd4f993c3dc26874e2bc990e9fb09bdb90ca3f2f88f870dbd0fe6f7d0fe72d'), - prev_index=1, - #script_sig= - ) - - out1 = proto.TxOutput(index=0, - address='1GnnT11aZeH6QZCtT7EjCvRF3EXHoY3owE', - address_n=[0, 1], - amount=50000, # 0.0005 BTC - script_type=proto.PAYTOADDRESS, - #script_args= - ) - - out2 = proto.TxOutput(index=1, - address='1FQVPnjrbkPWeA8poUoEnX9U3n9DyhAVtv', - #address_n=[], - amount=100000, # 0.001 BTC - script_type=proto.PAYTOADDRESS, - #script_args= - ) - - print binascii.hexlify(self.client.sign_tx([inp1], [out1, out2])[1]) - ''' - ''' - def test_workflow(self): - inp1 = proto.TxInput(index=0, - address_n=[1,0], - amount=100000000, - prev_hash='prevhash1234354346543456543654', - prev_index=11, - ) - - inp2 = proto.TxInput(index=1, - address_n=[2,0], - amount=100000000, - prev_hash='prevhash2222254346543456543654', - prev_index=11, - ) - - out1 = proto.TxOutput(index=0, - address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx', - amount=100000000, - script_type=proto.PAYTOADDRESS, - ) - - out2 = proto.TxOutput(index=1, - address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx', - #address_n=[], - amount=100000000, - script_type=proto.PAYTOADDRESS, - #script_args= - ) - - serialized = '' - - # Prepare and send initial message - tx = proto.SignTx() - tx.algo = proto.ELECTRUM - tx.random = self.client._get_local_entropy() - tx.inputs_count = 2 - tx.outputs_count = 2 - - res = self.client.call(tx) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXINPUT) - self.assertEqual(res.request_index, 0) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - # FIRST SIGNATURE - res = self.client.call(inp1) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXINPUT) - self.assertEqual(res.request_index, 1) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(inp2) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 0) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(out1) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 1) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(out2) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXINPUT) - self.assertEqual(res.request_index, 0) - self.assertNotEqual(res.signature, '') - self.assertNotEqual(res.serialized_tx, '') - serialized += res.serialized_tx - - # SECOND SIGNATURE - res = self.client.call(inp1) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXINPUT) - self.assertEqual(res.request_index, 1) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(inp2) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 0) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(out1) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 1) - self.assertEqual(res.signature, '') - self.assertEqual(res.serialized_tx, '') - - res = self.client.call(out2) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 0) - self.assertNotEqual(res.signature, '') - self.assertNotEqual(res.serialized_tx, '') - serialized += res.serialized_tx - - # FINALIZING OUTPUTS - res = self.client.call(out1) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, 1) - self.assertEqual(res.signature, '') - self.assertNotEqual(res.serialized_tx, '') - serialized += res.serialized_tx - - res = self.client.call(out2) - self.assertIsInstance(res, proto.TxRequest) - self.assertEqual(res.request_type, proto.TXOUTPUT) - self.assertEqual(res.request_index, -1) - self.assertEqual(res.signature, '') - self.assertNotEqual(res.serialized_tx, '') - serialized += res.serialized_tx - - print binascii.hexlify(serialized) - ''' - if __name__ == '__main__': unittest.main() diff --git a/tests/test_protection_levels.py b/tests/test_protection_levels.py index a8fa9a56e5..bb550acd6d 100644 --- a/tests/test_protection_levels.py +++ b/tests/test_protection_levels.py @@ -150,7 +150,7 @@ class TestProtectionLevels(common.TrezorTest): proto.PassphraseRequest(), proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), - proto.TxRequest(request_index=-1)]) + proto.TxRequest(finished=True)]) self.client.simple_sign_tx('Bitcoin', [inp1, ], [out1, ]) # def test_firmware_erase(self): diff --git a/trezorlib/api_blockchain.py b/trezorlib/api_blockchain.py index 56e4a0cdad..cc4e0b9b78 100644 --- a/trezorlib/api_blockchain.py +++ b/trezorlib/api_blockchain.py @@ -30,7 +30,7 @@ class BlockchainApi(object): def get_tx(self, txhash): # Build protobuf transaction structure from blockchain.info d = self._raw_tx(txhash) - t = proto_types.TransactionType() + t = proto_types.TransactionType(version = 1, lock_time = 0) for inp in d['inputs']: di = self._raw_tx(inp['prev_out']['tx_index']) diff --git a/trezorlib/messages_pb2.py b/trezorlib/messages_pb2.py index 2f33e84c1c..bfad63dc7b 100644 --- a/trezorlib/messages_pb2.py +++ b/trezorlib/messages_pb2.py @@ -15,7 +15,7 @@ import types_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='messages.proto', package='', - serialized_pb='\n\x0emessages.proto\x1a\x0btypes.proto\"\x0c\n\nInitialize\"\xbd\x02\n\x08\x46\x65\x61tures\x12\x0e\n\x06vendor\x18\x01 \x01(\t\x12\x15\n\rmajor_version\x18\x02 \x01(\r\x12\x15\n\rminor_version\x18\x03 \x01(\r\x12\x15\n\rpatch_version\x18\x04 \x01(\r\x12\x17\n\x0f\x62ootloader_mode\x18\x05 \x01(\x08\x12\x11\n\tdevice_id\x18\x06 \x01(\t\x12\x16\n\x0epin_protection\x18\x07 \x01(\x08\x12\x1d\n\x15passphrase_protection\x18\x08 \x01(\x08\x12\x10\n\x08language\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t\x12\x18\n\x05\x63oins\x18\x0b \x03(\x0b\x32\t.CoinType\x12\x13\n\x0binitialized\x18\x0c \x01(\x08\x12\x10\n\x08revision\x18\r \x01(\x0c\x12\x17\n\x0f\x62ootloader_hash\x18\x0e \x01(\x0c\"0\n\rApplySettings\x12\x10\n\x08language\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\"\x1b\n\tChangePin\x12\x0e\n\x06remove\x18\x01 \x01(\x08\"i\n\x04Ping\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x19\n\x11\x62utton_protection\x18\x02 \x01(\x08\x12\x16\n\x0epin_protection\x18\x03 \x01(\x08\x12\x1d\n\x15passphrase_protection\x18\x04 \x01(\x08\"\x1a\n\x07Success\x12\x0f\n\x07message\x18\x01 \x01(\t\"6\n\x07\x46\x61ilure\x12\x1a\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x0c.FailureType\x12\x0f\n\x07message\x18\x02 \x01(\t\"?\n\rButtonRequest\x12 \n\x04\x63ode\x18\x01 \x01(\x0e\x32\x12.ButtonRequestType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x0b\n\tButtonAck\"7\n\x10PinMatrixRequest\x12#\n\x04type\x18\x01 \x01(\x0e\x32\x15.PinMatrixRequestType\"\x1b\n\x0cPinMatrixAck\x12\x0b\n\x03pin\x18\x01 \x02(\t\"\x08\n\x06\x43\x61ncel\"\x13\n\x11PassphraseRequest\"#\n\rPassphraseAck\x12\x12\n\npassphrase\x18\x01 \x02(\t\"\x1a\n\nGetEntropy\x12\x0c\n\x04size\x18\x01 \x02(\r\"\x1a\n\x07\x45ntropy\x12\x0f\n\x07\x65ntropy\x18\x01 \x02(\x0c\"!\n\x0cGetPublicKey\x12\x11\n\taddress_n\x18\x01 \x03(\r\"&\n\tPublicKey\x12\x19\n\x04node\x18\x01 \x02(\x0b\x32\x0b.HDNodeType\";\n\nGetAddress\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x1a\n\tcoin_name\x18\x02 \x01(\t:\x07\x42itcoin\"\x1a\n\x07\x41\x64\x64ress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x02(\t\"\x0c\n\nWipeDevice\"\xa6\x01\n\nLoadDevice\x12\x10\n\x08mnemonic\x18\x01 \x01(\t\x12\x19\n\x04node\x18\x02 \x01(\x0b\x32\x0b.HDNodeType\x12\x0b\n\x03pin\x18\x03 \x01(\t\x12\x1d\n\x15passphrase_protection\x18\x04 \x01(\x08\x12\x19\n\x08language\x18\x05 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x06 \x01(\t\x12\x15\n\rskip_checksum\x18\x07 \x01(\x08\"\x9d\x01\n\x0bResetDevice\x12\x16\n\x0e\x64isplay_random\x18\x01 \x01(\x08\x12\x15\n\x08strength\x18\x02 \x01(\r:\x03\x31\x32\x38\x12\x1d\n\x15passphrase_protection\x18\x03 \x01(\x08\x12\x16\n\x0epin_protection\x18\x04 \x01(\x08\x12\x19\n\x08language\x18\x05 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x06 \x01(\t\"\x10\n\x0e\x45ntropyRequest\"\x1d\n\nEntropyAck\x12\x0f\n\x07\x65ntropy\x18\x01 \x01(\x0c\"\x9f\x01\n\x0eRecoveryDevice\x12\x12\n\nword_count\x18\x01 \x01(\r\x12\x1d\n\x15passphrase_protection\x18\x02 \x01(\x08\x12\x16\n\x0epin_protection\x18\x03 \x01(\x08\x12\x19\n\x08language\x18\x04 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x05 \x01(\t\x12\x18\n\x10\x65nforce_wordlist\x18\x06 \x01(\x08\"\r\n\x0bWordRequest\"\x17\n\x07WordAck\x12\x0c\n\x04word\x18\x01 \x02(\t\"M\n\x0bSignMessage\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x0f\n\x07message\x18\x02 \x02(\x0c\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"D\n\rVerifyMessage\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x0f\n\x07message\x18\x03 \x01(\x0c\"6\n\x10MessageSignature\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"Y\n\x0e\x45stimateTxSize\x12\x15\n\routputs_count\x18\x01 \x02(\r\x12\x14\n\x0cinputs_count\x18\x02 \x02(\r\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"\x19\n\x06TxSize\x12\x0f\n\x07tx_size\x18\x01 \x01(\r\"Q\n\x06SignTx\x12\x15\n\routputs_count\x18\x01 \x02(\r\x12\x14\n\x0cinputs_count\x18\x02 \x02(\r\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"\x90\x01\n\x0cSimpleSignTx\x12\x1c\n\x06inputs\x18\x01 \x03(\x0b\x32\x0c.TxInputType\x12\x1e\n\x07outputs\x18\x02 \x03(\x0b\x32\r.TxOutputType\x12&\n\x0ctransactions\x18\x03 \x03(\x0b\x32\x10.TransactionType\x12\x1a\n\tcoin_name\x18\x04 \x01(\t:\x07\x42itcoin\"\x86\x01\n\tTxRequest\x12\x15\n\rrequest_index\x18\x01 \x01(\x05\x12\"\n\x0crequest_type\x18\x02 \x01(\x0e\x32\x0c.RequestType\x12\x14\n\x0csigned_index\x18\x03 \x01(\x05\x12\x11\n\tsignature\x18\x04 \x01(\x0c\x12\x15\n\rserialized_tx\x18\x05 \x01(\x0c\"&\n\x07TxInput\x12\x1b\n\x05input\x18\x01 \x02(\x0b\x32\x0c.TxInputType\")\n\x08TxOutput\x12\x1d\n\x06output\x18\x01 \x02(\x0b\x32\r.TxOutputType\"\x0f\n\rFirmwareErase\"!\n\x0e\x46irmwareUpload\x12\x0f\n\x07payload\x18\x01 \x02(\x0c\"#\n\x11\x44\x65\x62ugLinkDecision\x12\x0e\n\x06yes_no\x18\x01 \x02(\x08\"\x13\n\x11\x44\x65\x62ugLinkGetState\"\xeb\x01\n\x0e\x44\x65\x62ugLinkState\x12\x0e\n\x06layout\x18\x01 \x01(\x0c\x12\x0b\n\x03pin\x18\x02 \x01(\t\x12\x0e\n\x06matrix\x18\x03 \x01(\t\x12\x10\n\x08mnemonic\x18\x04 \x01(\t\x12\x19\n\x04node\x18\x05 \x01(\x0b\x32\x0b.HDNodeType\x12\x1d\n\x15passphrase_protection\x18\x06 \x01(\x08\x12\x12\n\nreset_word\x18\x07 \x01(\t\x12\x15\n\rreset_entropy\x18\x08 \x01(\x0c\x12\x1a\n\x12recovery_fake_word\x18\t \x01(\t\x12\x19\n\x11recovery_word_pos\x18\n \x01(\r\"\x0f\n\rDebugLinkStop\";\n\x0c\x44\x65\x62ugLinkLog\x12\r\n\x05level\x18\x01 \x01(\r\x12\x0e\n\x06\x62ucket\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t*\xad\x0c\n\x0bMessageType\x12 \n\x16MessageType_Initialize\x10\x00\x1a\x04\x90\xb5\x18\x01\x12\x1a\n\x10MessageType_Ping\x10\x01\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Success\x10\x02\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_Failure\x10\x03\x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_ChangePin\x10\x04\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_WipeDevice\x10\x05\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_FirmwareErase\x10\x06\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_FirmwareUpload\x10\x07\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_GetEntropy\x10\t\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Entropy\x10\n\x1a\x04\x98\xb5\x18\x01\x12\"\n\x18MessageType_GetPublicKey\x10\x0b\x1a\x04\x90\xb5\x18\x01\x12\x1f\n\x15MessageType_PublicKey\x10\x0c\x1a\x04\x98\xb5\x18\x01\x12 \n\x16MessageType_LoadDevice\x10\r\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_ResetDevice\x10\x0e\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_SignTx\x10\x0f\x1a\x04\x90\xb5\x18\x01\x12\"\n\x18MessageType_SimpleSignTx\x10\x10\x1a\x04\x90\xb5\x18\x01\x12\x1e\n\x14MessageType_Features\x10\x11\x1a\x04\x98\xb5\x18\x01\x12&\n\x1cMessageType_PinMatrixRequest\x10\x12\x1a\x04\x98\xb5\x18\x01\x12\"\n\x18MessageType_PinMatrixAck\x10\x13\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_Cancel\x10\x14\x1a\x04\x90\xb5\x18\x01\x12\x1f\n\x15MessageType_TxRequest\x10\x15\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_TxInput\x10\x17\x1a\x04\x90\xb5\x18\x01\x12\x1e\n\x14MessageType_TxOutput\x10\x18\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ApplySettings\x10\x19\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ButtonRequest\x10\x1a\x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_ButtonAck\x10\x1b\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_GetAddress\x10\x1d\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Address\x10\x1e\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_EntropyRequest\x10#\x1a\x04\x98\xb5\x18\x01\x12 \n\x16MessageType_EntropyAck\x10$\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_SignMessage\x10&\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_VerifyMessage\x10\'\x1a\x04\x90\xb5\x18\x01\x12&\n\x1cMessageType_MessageSignature\x10(\x1a\x04\x98\xb5\x18\x01\x12\'\n\x1dMessageType_PassphraseRequest\x10)\x1a\x04\x98\xb5\x18\x01\x12#\n\x19MessageType_PassphraseAck\x10*\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_EstimateTxSize\x10+\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_TxSize\x10,\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_RecoveryDevice\x10-\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_WordRequest\x10.\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_WordAck\x10/\x1a\x04\x90\xb5\x18\x01\x12\'\n\x1dMessageType_DebugLinkDecision\x10\x64\x1a\x04\xa0\xb5\x18\x01\x12\'\n\x1dMessageType_DebugLinkGetState\x10\x65\x1a\x04\xa0\xb5\x18\x01\x12$\n\x1aMessageType_DebugLinkState\x10\x66\x1a\x04\xa8\xb5\x18\x01\x12#\n\x19MessageType_DebugLinkStop\x10g\x1a\x04\xa0\xb5\x18\x01\x12\"\n\x18MessageType_DebugLinkLog\x10h\x1a\x04\xa8\xb5\x18\x01\x42\x39\n(org.multibit.hd.hardware.trezor.protobufB\rTrezorMessage') + serialized_pb='\n\x0emessages.proto\x1a\x0btypes.proto\"\x0c\n\nInitialize\"\xbd\x02\n\x08\x46\x65\x61tures\x12\x0e\n\x06vendor\x18\x01 \x01(\t\x12\x15\n\rmajor_version\x18\x02 \x01(\r\x12\x15\n\rminor_version\x18\x03 \x01(\r\x12\x15\n\rpatch_version\x18\x04 \x01(\r\x12\x17\n\x0f\x62ootloader_mode\x18\x05 \x01(\x08\x12\x11\n\tdevice_id\x18\x06 \x01(\t\x12\x16\n\x0epin_protection\x18\x07 \x01(\x08\x12\x1d\n\x15passphrase_protection\x18\x08 \x01(\x08\x12\x10\n\x08language\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t\x12\x18\n\x05\x63oins\x18\x0b \x03(\x0b\x32\t.CoinType\x12\x13\n\x0binitialized\x18\x0c \x01(\x08\x12\x10\n\x08revision\x18\r \x01(\x0c\x12\x17\n\x0f\x62ootloader_hash\x18\x0e \x01(\x0c\"0\n\rApplySettings\x12\x10\n\x08language\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\"\x1b\n\tChangePin\x12\x0e\n\x06remove\x18\x01 \x01(\x08\"i\n\x04Ping\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x19\n\x11\x62utton_protection\x18\x02 \x01(\x08\x12\x16\n\x0epin_protection\x18\x03 \x01(\x08\x12\x1d\n\x15passphrase_protection\x18\x04 \x01(\x08\"\x1a\n\x07Success\x12\x0f\n\x07message\x18\x01 \x01(\t\"6\n\x07\x46\x61ilure\x12\x1a\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x0c.FailureType\x12\x0f\n\x07message\x18\x02 \x01(\t\"?\n\rButtonRequest\x12 \n\x04\x63ode\x18\x01 \x01(\x0e\x32\x12.ButtonRequestType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x0b\n\tButtonAck\"7\n\x10PinMatrixRequest\x12#\n\x04type\x18\x01 \x01(\x0e\x32\x15.PinMatrixRequestType\"\x1b\n\x0cPinMatrixAck\x12\x0b\n\x03pin\x18\x01 \x02(\t\"\x08\n\x06\x43\x61ncel\"\x13\n\x11PassphraseRequest\"#\n\rPassphraseAck\x12\x12\n\npassphrase\x18\x01 \x02(\t\"\x1a\n\nGetEntropy\x12\x0c\n\x04size\x18\x01 \x02(\r\"\x1a\n\x07\x45ntropy\x12\x0f\n\x07\x65ntropy\x18\x01 \x02(\x0c\"!\n\x0cGetPublicKey\x12\x11\n\taddress_n\x18\x01 \x03(\r\"&\n\tPublicKey\x12\x19\n\x04node\x18\x01 \x02(\x0b\x32\x0b.HDNodeType\";\n\nGetAddress\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x1a\n\tcoin_name\x18\x02 \x01(\t:\x07\x42itcoin\"\x1a\n\x07\x41\x64\x64ress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x02(\t\"\x0c\n\nWipeDevice\"\xa6\x01\n\nLoadDevice\x12\x10\n\x08mnemonic\x18\x01 \x01(\t\x12\x19\n\x04node\x18\x02 \x01(\x0b\x32\x0b.HDNodeType\x12\x0b\n\x03pin\x18\x03 \x01(\t\x12\x1d\n\x15passphrase_protection\x18\x04 \x01(\x08\x12\x19\n\x08language\x18\x05 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x06 \x01(\t\x12\x15\n\rskip_checksum\x18\x07 \x01(\x08\"\x9d\x01\n\x0bResetDevice\x12\x16\n\x0e\x64isplay_random\x18\x01 \x01(\x08\x12\x15\n\x08strength\x18\x02 \x01(\r:\x03\x31\x32\x38\x12\x1d\n\x15passphrase_protection\x18\x03 \x01(\x08\x12\x16\n\x0epin_protection\x18\x04 \x01(\x08\x12\x19\n\x08language\x18\x05 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x06 \x01(\t\"\x10\n\x0e\x45ntropyRequest\"\x1d\n\nEntropyAck\x12\x0f\n\x07\x65ntropy\x18\x01 \x01(\x0c\"\x9f\x01\n\x0eRecoveryDevice\x12\x12\n\nword_count\x18\x01 \x01(\r\x12\x1d\n\x15passphrase_protection\x18\x02 \x01(\x08\x12\x16\n\x0epin_protection\x18\x03 \x01(\x08\x12\x19\n\x08language\x18\x04 \x01(\t:\x07\x65nglish\x12\r\n\x05label\x18\x05 \x01(\t\x12\x18\n\x10\x65nforce_wordlist\x18\x06 \x01(\x08\"\r\n\x0bWordRequest\"\x17\n\x07WordAck\x12\x0c\n\x04word\x18\x01 \x02(\t\"M\n\x0bSignMessage\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x0f\n\x07message\x18\x02 \x02(\x0c\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"D\n\rVerifyMessage\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x0f\n\x07message\x18\x03 \x01(\x0c\"6\n\x10MessageSignature\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"Y\n\x0e\x45stimateTxSize\x12\x15\n\routputs_count\x18\x01 \x02(\r\x12\x14\n\x0cinputs_count\x18\x02 \x02(\r\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"\x19\n\x06TxSize\x12\x0f\n\x07tx_size\x18\x01 \x01(\r\"Q\n\x06SignTx\x12\x15\n\routputs_count\x18\x01 \x02(\r\x12\x14\n\x0cinputs_count\x18\x02 \x02(\r\x12\x1a\n\tcoin_name\x18\x03 \x01(\t:\x07\x42itcoin\"\x90\x01\n\x0cSimpleSignTx\x12\x1c\n\x06inputs\x18\x01 \x03(\x0b\x32\x0c.TxInputType\x12\x1e\n\x07outputs\x18\x02 \x03(\x0b\x32\r.TxOutputType\x12&\n\x0ctransactions\x18\x03 \x03(\x0b\x32\x10.TransactionType\x12\x1a\n\tcoin_name\x18\x04 \x01(\t:\x07\x42itcoin\"\xac\x01\n\tTxRequest\x12\x15\n\rrequest_index\x18\x01 \x01(\r\x12\"\n\x0crequest_type\x18\x02 \x01(\x0e\x32\x0c.RequestType\x12\x17\n\x0fsignature_index\x18\x03 \x01(\r\x12\x11\n\tsignature\x18\x04 \x01(\x0c\x12\x15\n\rserialized_tx\x18\x05 \x01(\x0c\x12\x0f\n\x07tx_hash\x18\x06 \x01(\x0c\x12\x10\n\x08\x66inished\x18\x07 \x01(\x08\"%\n\x05TxAck\x12\x1c\n\x02tx\x18\x01 \x01(\x0b\x32\x10.TransactionType\"\x0f\n\rFirmwareErase\"!\n\x0e\x46irmwareUpload\x12\x0f\n\x07payload\x18\x01 \x02(\x0c\"#\n\x11\x44\x65\x62ugLinkDecision\x12\x0e\n\x06yes_no\x18\x01 \x02(\x08\"\x13\n\x11\x44\x65\x62ugLinkGetState\"\xeb\x01\n\x0e\x44\x65\x62ugLinkState\x12\x0e\n\x06layout\x18\x01 \x01(\x0c\x12\x0b\n\x03pin\x18\x02 \x01(\t\x12\x0e\n\x06matrix\x18\x03 \x01(\t\x12\x10\n\x08mnemonic\x18\x04 \x01(\t\x12\x19\n\x04node\x18\x05 \x01(\x0b\x32\x0b.HDNodeType\x12\x1d\n\x15passphrase_protection\x18\x06 \x01(\x08\x12\x12\n\nreset_word\x18\x07 \x01(\t\x12\x15\n\rreset_entropy\x18\x08 \x01(\x0c\x12\x1a\n\x12recovery_fake_word\x18\t \x01(\t\x12\x19\n\x11recovery_word_pos\x18\n \x01(\r\"\x0f\n\rDebugLinkStop\";\n\x0c\x44\x65\x62ugLinkLog\x12\r\n\x05level\x18\x01 \x01(\r\x12\x0e\n\x06\x62ucket\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t*\x8b\x0c\n\x0bMessageType\x12 \n\x16MessageType_Initialize\x10\x00\x1a\x04\x90\xb5\x18\x01\x12\x1a\n\x10MessageType_Ping\x10\x01\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Success\x10\x02\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_Failure\x10\x03\x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_ChangePin\x10\x04\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_WipeDevice\x10\x05\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_FirmwareErase\x10\x06\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_FirmwareUpload\x10\x07\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_GetEntropy\x10\t\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Entropy\x10\n\x1a\x04\x98\xb5\x18\x01\x12\"\n\x18MessageType_GetPublicKey\x10\x0b\x1a\x04\x90\xb5\x18\x01\x12\x1f\n\x15MessageType_PublicKey\x10\x0c\x1a\x04\x98\xb5\x18\x01\x12 \n\x16MessageType_LoadDevice\x10\r\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_ResetDevice\x10\x0e\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_SignTx\x10\x0f\x1a\x04\x90\xb5\x18\x01\x12\"\n\x18MessageType_SimpleSignTx\x10\x10\x1a\x04\x90\xb5\x18\x01\x12\x1e\n\x14MessageType_Features\x10\x11\x1a\x04\x98\xb5\x18\x01\x12&\n\x1cMessageType_PinMatrixRequest\x10\x12\x1a\x04\x98\xb5\x18\x01\x12\"\n\x18MessageType_PinMatrixAck\x10\x13\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_Cancel\x10\x14\x1a\x04\x90\xb5\x18\x01\x12\x1f\n\x15MessageType_TxRequest\x10\x15\x1a\x04\x98\xb5\x18\x01\x12\x1b\n\x11MessageType_TxAck\x10\x16\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ApplySettings\x10\x19\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ButtonRequest\x10\x1a\x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_ButtonAck\x10\x1b\x1a\x04\x90\xb5\x18\x01\x12 \n\x16MessageType_GetAddress\x10\x1d\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Address\x10\x1e\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_EntropyRequest\x10#\x1a\x04\x98\xb5\x18\x01\x12 \n\x16MessageType_EntropyAck\x10$\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_SignMessage\x10&\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_VerifyMessage\x10\'\x1a\x04\x90\xb5\x18\x01\x12&\n\x1cMessageType_MessageSignature\x10(\x1a\x04\x98\xb5\x18\x01\x12\'\n\x1dMessageType_PassphraseRequest\x10)\x1a\x04\x98\xb5\x18\x01\x12#\n\x19MessageType_PassphraseAck\x10*\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_EstimateTxSize\x10+\x1a\x04\x90\xb5\x18\x01\x12\x1c\n\x12MessageType_TxSize\x10,\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_RecoveryDevice\x10-\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_WordRequest\x10.\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_WordAck\x10/\x1a\x04\x90\xb5\x18\x01\x12\'\n\x1dMessageType_DebugLinkDecision\x10\x64\x1a\x04\xa0\xb5\x18\x01\x12\'\n\x1dMessageType_DebugLinkGetState\x10\x65\x1a\x04\xa0\xb5\x18\x01\x12$\n\x1aMessageType_DebugLinkState\x10\x66\x1a\x04\xa8\xb5\x18\x01\x12#\n\x19MessageType_DebugLinkStop\x10g\x1a\x04\xa0\xb5\x18\x01\x12\"\n\x18MessageType_DebugLinkLog\x10h\x1a\x04\xa8\xb5\x18\x01\x42\x39\n(org.multibit.hd.hardware.trezor.protobufB\rTrezorMessage') _MESSAGETYPE = _descriptor.EnumDescriptor( name='MessageType', @@ -108,106 +108,102 @@ _MESSAGETYPE = _descriptor.EnumDescriptor( options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_TxInput', index=21, number=23, + name='MessageType_TxAck', index=21, number=22, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_TxOutput', index=22, number=24, + name='MessageType_ApplySettings', index=22, number=25, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_ApplySettings', index=23, number=25, - options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), - type=None), - _descriptor.EnumValueDescriptor( - name='MessageType_ButtonRequest', index=24, number=26, + name='MessageType_ButtonRequest', index=23, number=26, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_ButtonAck', index=25, number=27, + name='MessageType_ButtonAck', index=24, number=27, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_GetAddress', index=26, number=29, + name='MessageType_GetAddress', index=25, number=29, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_Address', index=27, number=30, + name='MessageType_Address', index=26, number=30, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_EntropyRequest', index=28, number=35, + name='MessageType_EntropyRequest', index=27, number=35, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_EntropyAck', index=29, number=36, + name='MessageType_EntropyAck', index=28, number=36, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_SignMessage', index=30, number=38, + name='MessageType_SignMessage', index=29, number=38, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_VerifyMessage', index=31, number=39, + name='MessageType_VerifyMessage', index=30, number=39, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_MessageSignature', index=32, number=40, + name='MessageType_MessageSignature', index=31, number=40, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_PassphraseRequest', index=33, number=41, + name='MessageType_PassphraseRequest', index=32, number=41, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_PassphraseAck', index=34, number=42, + name='MessageType_PassphraseAck', index=33, number=42, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_EstimateTxSize', index=35, number=43, + name='MessageType_EstimateTxSize', index=34, number=43, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_TxSize', index=36, number=44, + name='MessageType_TxSize', index=35, number=44, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_RecoveryDevice', index=37, number=45, + name='MessageType_RecoveryDevice', index=36, number=45, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_WordRequest', index=38, number=46, + name='MessageType_WordRequest', index=37, number=46, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_WordAck', index=39, number=47, + name='MessageType_WordAck', index=38, number=47, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_DebugLinkDecision', index=40, number=100, + name='MessageType_DebugLinkDecision', index=39, number=100, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\240\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_DebugLinkGetState', index=41, number=101, + name='MessageType_DebugLinkGetState', index=40, number=101, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\240\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_DebugLinkState', index=42, number=102, + name='MessageType_DebugLinkState', index=41, number=102, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\250\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_DebugLinkStop', index=43, number=103, + name='MessageType_DebugLinkStop', index=42, number=103, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\240\265\030\001'), type=None), _descriptor.EnumValueDescriptor( - name='MessageType_DebugLinkLog', index=44, number=104, + name='MessageType_DebugLinkLog', index=43, number=104, options=_descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\250\265\030\001'), type=None), ], containing_type=None, options=None, - serialized_start=2881, - serialized_end=4462, + serialized_start=2875, + serialized_end=4422, ) MessageType = enum_type_wrapper.EnumTypeWrapper(_MESSAGETYPE) @@ -232,8 +228,7 @@ MessageType_PinMatrixRequest = 18 MessageType_PinMatrixAck = 19 MessageType_Cancel = 20 MessageType_TxRequest = 21 -MessageType_TxInput = 23 -MessageType_TxOutput = 24 +MessageType_TxAck = 22 MessageType_ApplySettings = 25 MessageType_ButtonRequest = 26 MessageType_ButtonAck = 27 @@ -1535,7 +1530,7 @@ _TXREQUEST = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='request_index', full_name='TxRequest.request_index', index=0, - number=1, type=5, cpp_type=1, label=1, + number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1548,8 +1543,8 @@ _TXREQUEST = _descriptor.Descriptor( is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='signed_index', full_name='TxRequest.signed_index', index=2, - number=3, type=5, cpp_type=1, label=1, + name='signature_index', full_name='TxRequest.signature_index', index=2, + number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1568,6 +1563,20 @@ _TXREQUEST = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='tx_hash', full_name='TxRequest.tx_hash', index=5, + number=6, type=12, cpp_type=9, label=1, + has_default_value=False, default_value="", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='finished', full_name='TxRequest.finished', index=6, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -1578,20 +1587,20 @@ _TXREQUEST = _descriptor.Descriptor( is_extendable=False, extension_ranges=[], serialized_start=2235, - serialized_end=2369, + serialized_end=2407, ) -_TXINPUT = _descriptor.Descriptor( - name='TxInput', - full_name='TxInput', +_TXACK = _descriptor.Descriptor( + name='TxAck', + full_name='TxAck', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='input', full_name='TxInput.input', index=0, - number=1, type=11, cpp_type=10, label=2, + name='tx', full_name='TxAck.tx', index=0, + number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1605,36 +1614,8 @@ _TXINPUT = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2371, - serialized_end=2409, -) - - -_TXOUTPUT = _descriptor.Descriptor( - name='TxOutput', - full_name='TxOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='output', full_name='TxOutput.output', index=0, - number=1, type=11, cpp_type=10, label=2, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - extension_ranges=[], - serialized_start=2411, - serialized_end=2452, + serialized_start=2409, + serialized_end=2446, ) @@ -1654,8 +1635,8 @@ _FIRMWAREERASE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2454, - serialized_end=2469, + serialized_start=2448, + serialized_end=2463, ) @@ -1682,8 +1663,8 @@ _FIRMWAREUPLOAD = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2471, - serialized_end=2504, + serialized_start=2465, + serialized_end=2498, ) @@ -1710,8 +1691,8 @@ _DEBUGLINKDECISION = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2506, - serialized_end=2541, + serialized_start=2500, + serialized_end=2535, ) @@ -1731,8 +1712,8 @@ _DEBUGLINKGETSTATE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2543, - serialized_end=2562, + serialized_start=2537, + serialized_end=2556, ) @@ -1822,8 +1803,8 @@ _DEBUGLINKSTATE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2565, - serialized_end=2800, + serialized_start=2559, + serialized_end=2794, ) @@ -1843,8 +1824,8 @@ _DEBUGLINKSTOP = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2802, - serialized_end=2817, + serialized_start=2796, + serialized_end=2811, ) @@ -1885,8 +1866,8 @@ _DEBUGLINKLOG = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=2819, - serialized_end=2878, + serialized_start=2813, + serialized_end=2872, ) _FEATURES.fields_by_name['coins'].message_type = types_pb2._COINTYPE @@ -1899,8 +1880,7 @@ _SIMPLESIGNTX.fields_by_name['inputs'].message_type = types_pb2._TXINPUTTYPE _SIMPLESIGNTX.fields_by_name['outputs'].message_type = types_pb2._TXOUTPUTTYPE _SIMPLESIGNTX.fields_by_name['transactions'].message_type = types_pb2._TRANSACTIONTYPE _TXREQUEST.fields_by_name['request_type'].enum_type = types_pb2._REQUESTTYPE -_TXINPUT.fields_by_name['input'].message_type = types_pb2._TXINPUTTYPE -_TXOUTPUT.fields_by_name['output'].message_type = types_pb2._TXOUTPUTTYPE +_TXACK.fields_by_name['tx'].message_type = types_pb2._TRANSACTIONTYPE _DEBUGLINKSTATE.fields_by_name['node'].message_type = types_pb2._HDNODETYPE DESCRIPTOR.message_types_by_name['Initialize'] = _INITIALIZE DESCRIPTOR.message_types_by_name['Features'] = _FEATURES @@ -1938,8 +1918,7 @@ DESCRIPTOR.message_types_by_name['TxSize'] = _TXSIZE DESCRIPTOR.message_types_by_name['SignTx'] = _SIGNTX DESCRIPTOR.message_types_by_name['SimpleSignTx'] = _SIMPLESIGNTX DESCRIPTOR.message_types_by_name['TxRequest'] = _TXREQUEST -DESCRIPTOR.message_types_by_name['TxInput'] = _TXINPUT -DESCRIPTOR.message_types_by_name['TxOutput'] = _TXOUTPUT +DESCRIPTOR.message_types_by_name['TxAck'] = _TXACK DESCRIPTOR.message_types_by_name['FirmwareErase'] = _FIRMWAREERASE DESCRIPTOR.message_types_by_name['FirmwareUpload'] = _FIRMWAREUPLOAD DESCRIPTOR.message_types_by_name['DebugLinkDecision'] = _DEBUGLINKDECISION @@ -2164,17 +2143,11 @@ class TxRequest(_message.Message): # @@protoc_insertion_point(class_scope:TxRequest) -class TxInput(_message.Message): +class TxAck(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType - DESCRIPTOR = _TXINPUT + DESCRIPTOR = _TXACK - # @@protoc_insertion_point(class_scope:TxInput) - -class TxOutput(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType - DESCRIPTOR = _TXOUTPUT - - # @@protoc_insertion_point(class_scope:TxOutput) + # @@protoc_insertion_point(class_scope:TxAck) class FirmwareErase(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType @@ -2263,10 +2236,8 @@ _MESSAGETYPE.values_by_name["MessageType_Cancel"].has_options = True _MESSAGETYPE.values_by_name["MessageType_Cancel"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001') _MESSAGETYPE.values_by_name["MessageType_TxRequest"].has_options = True _MESSAGETYPE.values_by_name["MessageType_TxRequest"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\230\265\030\001') -_MESSAGETYPE.values_by_name["MessageType_TxInput"].has_options = True -_MESSAGETYPE.values_by_name["MessageType_TxInput"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001') -_MESSAGETYPE.values_by_name["MessageType_TxOutput"].has_options = True -_MESSAGETYPE.values_by_name["MessageType_TxOutput"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001') +_MESSAGETYPE.values_by_name["MessageType_TxAck"].has_options = True +_MESSAGETYPE.values_by_name["MessageType_TxAck"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001') _MESSAGETYPE.values_by_name["MessageType_ApplySettings"].has_options = True _MESSAGETYPE.values_by_name["MessageType_ApplySettings"]._options = _descriptor._ParseOptions(descriptor_pb2.EnumValueOptions(), '\220\265\030\001') _MESSAGETYPE.values_by_name["MessageType_ButtonRequest"].has_options = True diff --git a/trezorlib/types_pb2.py b/trezorlib/types_pb2.py index 109b9ce4e6..75e5cfa191 100644 --- a/trezorlib/types_pb2.py +++ b/trezorlib/types_pb2.py @@ -15,7 +15,7 @@ import google.protobuf.descriptor_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='types.proto', package='', - serialized_pb='\n\x0btypes.proto\x1a google/protobuf/descriptor.proto\"\x80\x01\n\nHDNodeType\x12\r\n\x05\x64\x65pth\x18\x01 \x02(\r\x12\x13\n\x0b\x66ingerprint\x18\x02 \x02(\r\x12\x11\n\tchild_num\x18\x03 \x02(\r\x12\x12\n\nchain_code\x18\x04 \x02(\x0c\x12\x13\n\x0bprivate_key\x18\x05 \x01(\x0c\x12\x12\n\npublic_key\x18\x06 \x01(\x0c\"]\n\x08\x43oinType\x12\x11\n\tcoin_name\x18\x01 \x01(\t\x12\x15\n\rcoin_shortcut\x18\x02 \x01(\t\x12\x14\n\x0c\x61\x64\x64ress_type\x18\x03 \x01(\r\x12\x11\n\tmaxfee_kb\x18\x04 \x01(\x04\"y\n\x0bTxInputType\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x11\n\tprev_hash\x18\x02 \x02(\x0c\x12\x12\n\nprev_index\x18\x03 \x02(\r\x12\x12\n\nscript_sig\x18\x04 \x01(\x0c\x12\x1c\n\x08sequence\x18\x05 \x01(\r:\n4294967295\"y\n\x0cTxOutputType\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\taddress_n\x18\x02 \x03(\r\x12\x0e\n\x06\x61mount\x18\x03 \x02(\x04\x12 \n\x0bscript_type\x18\x04 \x02(\x0e\x32\x0b.ScriptType\x12\x13\n\x0bscript_args\x18\x05 \x03(\x0c\"8\n\x0fTxOutputBinType\x12\x0e\n\x06\x61mount\x18\x01 \x02(\x04\x12\x15\n\rscript_pubkey\x18\x02 \x02(\x0c\"|\n\x0fTransactionType\x12\x12\n\x07version\x18\x01 \x01(\r:\x01\x31\x12\x1c\n\x06inputs\x18\x02 \x03(\x0b\x32\x0c.TxInputType\x12!\n\x07outputs\x18\x03 \x03(\x0b\x32\x10.TxOutputBinType\x12\x14\n\tlock_time\x18\x04 \x01(\r:\x01\x30*\xcd\x02\n\x0b\x46\x61ilureType\x12\x1d\n\x19\x46\x61ilure_UnexpectedMessage\x10\x01\x12\x1a\n\x16\x46\x61ilure_ButtonExpected\x10\x02\x12\x17\n\x13\x46\x61ilure_SyntaxError\x10\x03\x12\x1b\n\x17\x46\x61ilure_ActionCancelled\x10\x04\x12\x17\n\x13\x46\x61ilure_PinExpected\x10\x05\x12\x18\n\x14\x46\x61ilure_PinCancelled\x10\x06\x12\x16\n\x12\x46\x61ilure_PinInvalid\x10\x07\x12\x1c\n\x18\x46\x61ilure_InvalidSignature\x10\x08\x12\x11\n\rFailure_Other\x10\t\x12\x1a\n\x16\x46\x61ilure_NotEnoughFunds\x10\n\x12\x1a\n\x16\x46\x61ilure_NotInitialized\x10\x0b\x12\x19\n\x15\x46\x61ilure_FirmwareError\x10\x63*3\n\nScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01*(\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\x00\x12\x0c\n\x08TXOUTPUT\x10\x01*\x86\x02\n\x11\x42uttonRequestType\x12\x17\n\x13\x42uttonRequest_Other\x10\x01\x12\"\n\x1e\x42uttonRequest_FeeOverThreshold\x10\x02\x12\x1f\n\x1b\x42uttonRequest_ConfirmOutput\x10\x03\x12\x1d\n\x19\x42uttonRequest_ResetDevice\x10\x04\x12\x1d\n\x19\x42uttonRequest_ConfirmWord\x10\x05\x12\x1c\n\x18\x42uttonRequest_WipeDevice\x10\x06\x12\x1d\n\x19\x42uttonRequest_ProtectCall\x10\x07\x12\x18\n\x14\x42uttonRequest_SignTx\x10\x08*\x7f\n\x14PinMatrixRequestType\x12 \n\x1cPinMatrixRequestType_Current\x10\x01\x12!\n\x1dPinMatrixRequestType_NewFirst\x10\x02\x12\"\n\x1ePinMatrixRequestType_NewSecond\x10\x03:4\n\x07wire_in\x12!.google.protobuf.EnumValueOptions\x18\xd2\x86\x03 \x01(\x08:5\n\x08wire_out\x12!.google.protobuf.EnumValueOptions\x18\xd3\x86\x03 \x01(\x08::\n\rwire_debug_in\x12!.google.protobuf.EnumValueOptions\x18\xd4\x86\x03 \x01(\x08:;\n\x0ewire_debug_out\x12!.google.protobuf.EnumValueOptions\x18\xd5\x86\x03 \x01(\x08\x42\x36\n(org.multibit.hd.hardware.trezor.protobufB\nTrezorType') + serialized_pb='\n\x0btypes.proto\x1a google/protobuf/descriptor.proto\"\x80\x01\n\nHDNodeType\x12\r\n\x05\x64\x65pth\x18\x01 \x02(\r\x12\x13\n\x0b\x66ingerprint\x18\x02 \x02(\r\x12\x11\n\tchild_num\x18\x03 \x02(\r\x12\x12\n\nchain_code\x18\x04 \x02(\x0c\x12\x13\n\x0bprivate_key\x18\x05 \x01(\x0c\x12\x12\n\npublic_key\x18\x06 \x01(\x0c\"]\n\x08\x43oinType\x12\x11\n\tcoin_name\x18\x01 \x01(\t\x12\x15\n\rcoin_shortcut\x18\x02 \x01(\t\x12\x14\n\x0c\x61\x64\x64ress_type\x18\x03 \x01(\r\x12\x11\n\tmaxfee_kb\x18\x04 \x01(\x04\"y\n\x0bTxInputType\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x11\n\tprev_hash\x18\x02 \x02(\x0c\x12\x12\n\nprev_index\x18\x03 \x02(\r\x12\x12\n\nscript_sig\x18\x04 \x01(\x0c\x12\x1c\n\x08sequence\x18\x05 \x01(\r:\n4294967295\"y\n\x0cTxOutputType\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x11\n\taddress_n\x18\x02 \x03(\r\x12\x0e\n\x06\x61mount\x18\x03 \x02(\x04\x12 \n\x0bscript_type\x18\x04 \x02(\x0e\x32\x0b.ScriptType\x12\x13\n\x0bscript_args\x18\x05 \x03(\x0c\"8\n\x0fTxOutputBinType\x12\x0e\n\x06\x61mount\x18\x01 \x02(\x04\x12\x15\n\rscript_pubkey\x18\x02 \x02(\x0c\"\x9a\x01\n\x0fTransactionType\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x1c\n\x06inputs\x18\x02 \x03(\x0b\x32\x0c.TxInputType\x12!\n\x07outputs\x18\x03 \x03(\x0b\x32\x10.TxOutputBinType\x12\"\n\x0bour_outputs\x18\x04 \x03(\x0b\x32\r.TxOutputType\x12\x11\n\tlock_time\x18\x05 \x01(\r*\xcd\x02\n\x0b\x46\x61ilureType\x12\x1d\n\x19\x46\x61ilure_UnexpectedMessage\x10\x01\x12\x1a\n\x16\x46\x61ilure_ButtonExpected\x10\x02\x12\x17\n\x13\x46\x61ilure_SyntaxError\x10\x03\x12\x1b\n\x17\x46\x61ilure_ActionCancelled\x10\x04\x12\x17\n\x13\x46\x61ilure_PinExpected\x10\x05\x12\x18\n\x14\x46\x61ilure_PinCancelled\x10\x06\x12\x16\n\x12\x46\x61ilure_PinInvalid\x10\x07\x12\x1c\n\x18\x46\x61ilure_InvalidSignature\x10\x08\x12\x11\n\rFailure_Other\x10\t\x12\x1a\n\x16\x46\x61ilure_NotEnoughFunds\x10\n\x12\x1a\n\x16\x46\x61ilure_NotInitialized\x10\x0b\x12\x19\n\x15\x46\x61ilure_FirmwareError\x10\x63*3\n\nScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01*4\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\x00\x12\x0c\n\x08TXOUTPUT\x10\x01\x12\n\n\x06TXMETA\x10\x02*\x86\x02\n\x11\x42uttonRequestType\x12\x17\n\x13\x42uttonRequest_Other\x10\x01\x12\"\n\x1e\x42uttonRequest_FeeOverThreshold\x10\x02\x12\x1f\n\x1b\x42uttonRequest_ConfirmOutput\x10\x03\x12\x1d\n\x19\x42uttonRequest_ResetDevice\x10\x04\x12\x1d\n\x19\x42uttonRequest_ConfirmWord\x10\x05\x12\x1c\n\x18\x42uttonRequest_WipeDevice\x10\x06\x12\x1d\n\x19\x42uttonRequest_ProtectCall\x10\x07\x12\x18\n\x14\x42uttonRequest_SignTx\x10\x08*\x7f\n\x14PinMatrixRequestType\x12 \n\x1cPinMatrixRequestType_Current\x10\x01\x12!\n\x1dPinMatrixRequestType_NewFirst\x10\x02\x12\"\n\x1ePinMatrixRequestType_NewSecond\x10\x03:4\n\x07wire_in\x12!.google.protobuf.EnumValueOptions\x18\xd2\x86\x03 \x01(\x08:5\n\x08wire_out\x12!.google.protobuf.EnumValueOptions\x18\xd3\x86\x03 \x01(\x08::\n\rwire_debug_in\x12!.google.protobuf.EnumValueOptions\x18\xd4\x86\x03 \x01(\x08:;\n\x0ewire_debug_out\x12!.google.protobuf.EnumValueOptions\x18\xd5\x86\x03 \x01(\x08\x42\x36\n(org.multibit.hd.hardware.trezor.protobufB\nTrezorType') _FAILURETYPE = _descriptor.EnumDescriptor( name='FailureType', @@ -74,8 +74,8 @@ _FAILURETYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=706, - serialized_end=1039, + serialized_start=737, + serialized_end=1070, ) FailureType = enum_type_wrapper.EnumTypeWrapper(_FAILURETYPE) @@ -96,8 +96,8 @@ _SCRIPTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1041, - serialized_end=1092, + serialized_start=1072, + serialized_end=1123, ) ScriptType = enum_type_wrapper.EnumTypeWrapper(_SCRIPTTYPE) @@ -115,11 +115,15 @@ _REQUESTTYPE = _descriptor.EnumDescriptor( name='TXOUTPUT', index=1, number=1, options=None, type=None), + _descriptor.EnumValueDescriptor( + name='TXMETA', index=2, number=2, + options=None, + type=None), ], containing_type=None, options=None, - serialized_start=1094, - serialized_end=1134, + serialized_start=1125, + serialized_end=1177, ) RequestType = enum_type_wrapper.EnumTypeWrapper(_REQUESTTYPE) @@ -164,8 +168,8 @@ _BUTTONREQUESTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1137, - serialized_end=1399, + serialized_start=1180, + serialized_end=1442, ) ButtonRequestType = enum_type_wrapper.EnumTypeWrapper(_BUTTONREQUESTTYPE) @@ -190,8 +194,8 @@ _PINMATRIXREQUESTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1401, - serialized_end=1528, + serialized_start=1444, + serialized_end=1571, ) PinMatrixRequestType = enum_type_wrapper.EnumTypeWrapper(_PINMATRIXREQUESTTYPE) @@ -211,6 +215,7 @@ PAYTOADDRESS = 0 PAYTOSCRIPTHASH = 1 TXINPUT = 0 TXOUTPUT = 1 +TXMETA = 2 ButtonRequest_Other = 1 ButtonRequest_FeeOverThreshold = 2 ButtonRequest_ConfirmOutput = 3 @@ -526,7 +531,7 @@ _TRANSACTIONTYPE = _descriptor.Descriptor( _descriptor.FieldDescriptor( name='version', full_name='TransactionType.version', index=0, number=1, type=13, cpp_type=3, label=1, - has_default_value=True, default_value=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -545,9 +550,16 @@ _TRANSACTIONTYPE = _descriptor.Descriptor( is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='lock_time', full_name='TransactionType.lock_time', index=3, - number=4, type=13, cpp_type=3, label=1, - has_default_value=True, default_value=0, + name='our_outputs', full_name='TransactionType.our_outputs', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='lock_time', full_name='TransactionType.lock_time', index=4, + number=5, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -560,13 +572,14 @@ _TRANSACTIONTYPE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=579, - serialized_end=703, + serialized_start=580, + serialized_end=734, ) _TXOUTPUTTYPE.fields_by_name['script_type'].enum_type = _SCRIPTTYPE _TRANSACTIONTYPE.fields_by_name['inputs'].message_type = _TXINPUTTYPE _TRANSACTIONTYPE.fields_by_name['outputs'].message_type = _TXOUTPUTBINTYPE +_TRANSACTIONTYPE.fields_by_name['our_outputs'].message_type = _TXOUTPUTTYPE DESCRIPTOR.message_types_by_name['HDNodeType'] = _HDNODETYPE DESCRIPTOR.message_types_by_name['CoinType'] = _COINTYPE DESCRIPTOR.message_types_by_name['TxInputType'] = _TXINPUTTYPE