From 22faa4cafa24ef10a4e82d3b24ad75798444909a Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 21 Oct 2016 15:24:30 +0200 Subject: [PATCH] add msg_signtx_zcash unittest --- tests/common.py | 4 ++ tests/test_msg_signtx_zcash.py | 55 +++++++++++++++++++++++++ trezorlib/client.py | 8 ++++ trezorlib/tx_api.py | 20 +++++++++- trezorlib/types_pb2.py | 73 ++++++++++++++++++++++++---------- 5 files changed, 139 insertions(+), 21 deletions(-) create mode 100644 tests/test_msg_signtx_zcash.py diff --git a/tests/common.py b/tests/common.py index 3a8bd90b4..16dac1475 100644 --- a/tests/common.py +++ b/tests/common.py @@ -18,6 +18,7 @@ class TrezorTest(unittest.TestCase): self.mnemonic12 = 'alcohol woman abuse must during monitor noble actual mixed trade anger aisle' self.mnemonic18 = 'owner little vague addict embark decide pink prosper true fork panda embody mixture exchange choose canoe electric jewel' self.mnemonic24 = 'dignity pass list indicate nasty swamp pool script soccer toe leaf photo multiply desk host tomato cradle drill spread actor shine dismiss champion exotic' + self.mnemonic_all = ' '.join(['all'] * 12) self.pin4 = '1234' self.pin6 = '789456' @@ -28,6 +29,9 @@ class TrezorTest(unittest.TestCase): print("Setup finished") print("--------------") + def setup_mnemonic_allallall(self): + self.client.load_device_by_mnemonic(mnemonic=self.mnemonic_all, pin='', passphrase_protection=False, label='test', language='english') + def setup_mnemonic_nopin_nopassphrase(self): self.client.load_device_by_mnemonic(mnemonic=self.mnemonic12, pin='', passphrase_protection=False, label='test', language='english') diff --git a/tests/test_msg_signtx_zcash.py b/tests/test_msg_signtx_zcash.py new file mode 100644 index 000000000..bbad6f612 --- /dev/null +++ b/tests/test_msg_signtx_zcash.py @@ -0,0 +1,55 @@ +import unittest +import common +import binascii + +import trezorlib.messages_pb2 as proto +import trezorlib.types_pb2 as proto_types +from trezorlib.client import CallException +from trezorlib.tx_api import TXAPIZcashTestnet + +class TestMsgSigntx(common.TrezorTest): + + def test_one_one_fee(self): + self.setup_mnemonic_allallall() + + # tx: 83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9 + # input 0: 2.1 TAZ + + inp1 = proto_types.TxInputType(address_n=[2147483692, 2147483649, 2147483648, 0, 0], # tmQoJ3PTXgQLaRRZZYT6xk8XtjRbr2kCqwu + # amount=210000000, + prev_hash=binascii.unhexlify(b'83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9'), + prev_index=0, + ) + + out1 = proto_types.TxOutputType(address='tmJ1xYxP8XNTtCoDgvdmQPSrxh5qZJgy65Z', + amount=210000000 - 1940, + script_type=proto_types.PAYTOADDRESS, + ) + + with self.client: + self.client.set_tx_api(TXAPIZcashTestnet()) + self.client.set_expected_responses([ + proto.TxRequest(request_type=proto_types.TXINPUT, details=proto_types.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto_types.TXMETA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9"))), + proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0, tx_hash=binascii.unhexlify(b"83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9"))), + proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9"),extra_data_offset=0, extra_data_len=1024)), + proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"83fc9d26e90ed70f161cbd4b6af6c4cf5d27525dedd5477d054b9a4935cf01d9"),extra_data_offset=1024, extra_data_len=875)), + proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)), + proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), + proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), + proto.TxRequest(request_type=proto_types.TXINPUT, details=proto_types.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)), + proto.TxRequest(request_type=proto_types.TXFINISHED), + ]) + + (signatures, serialized_tx) = self.client.sign_tx('Zcash Testnet', [inp1, ], [out1, ]) + + self.assertEqual(len(signatures), 1) + self.assertEqual(binascii.hexlify(signatures[0]), b'3045022100adb008fb056919eeeb61285689048333a0e782208a04d84d1b7bd5eb42f231d6022064a0c903723025d52ee664354b048127d076a68c77d459d1b822168b6db241e6') + + # Accepted by network: tx 1c2a9faa81403643b8d17de905db64bb9c6e50a49ac9cc5688588d676efd5687 + self.assertEqual(binascii.hexlify(serialized_tx), b'0100000001d901cf35499a4b057d47d5ed5d52275dcfc4f66a4bbd1c160fd70ee9269dfc83000000006b483045022100adb008fb056919eeeb61285689048333a0e782208a04d84d1b7bd5eb42f231d6022064a0c903723025d52ee664354b048127d076a68c77d459d1b822168b6db241e60121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff01ec50840c000000001976a9145b157a678a10021243307e4bb58f36375aa80e1088ac00000000') + +if __name__ == '__main__': + unittest.main() diff --git a/trezorlib/client.py b/trezorlib/client.py index 5053d5b71..eac9747f5 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -681,6 +681,7 @@ class ProtocolMixin(object): msg.outputs_cnt = len(current_tx.bin_outputs) else: msg.outputs_cnt = len(current_tx.outputs) + msg.extra_data_len = len(current_tx.extra_data) res = self.call(proto.TxAck(tx=msg)) continue @@ -706,6 +707,13 @@ class ProtocolMixin(object): res = self.call(proto.TxAck(tx=msg)) continue + elif res.request_type == types.TXEXTRADATA: + o, l = res.details.extra_data_offset, res.details.extra_data_len + msg = types.TransactionType() + msg.extra_data = current_tx.extra_data[o:o + l] + res = self.call(proto.TxAck(tx=msg)) + continue + if None in signatures: raise Exception("Some signatures are missing!") diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index d0ef30806..3308e8c13 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -11,7 +11,7 @@ def fetch_json(url): except: raise Exception('URL error: %s' % url) -def insight_tx(url, rawdata=False): +def insight_tx(url, rawdata=False, zcash=False): if not rawdata: data = fetch_json(url) else: @@ -40,6 +40,17 @@ def insight_tx(url, rawdata=False): o.amount = int(Decimal(str(vout['value'])) * 100000000) o.script_pubkey = binascii.unhexlify(vout['scriptPubKey']['hex']) + if zcash: + if t.version == 2: + joinsplit_cnt = len(data['vjoinsplit']) + if joinsplit_cnt == 0: + t.extra_data =b'\x00' + else: + extra_data_len = 1 + joinsplit_cnt * 1802 + 32 + 64 # we assume cnt < 253, so we can treat varIntLen(cnt) as 1 + raw = fetch_json(url.replace('/tx/', '/rawtx/')) + raw = binascii.unhexlify(raw['rawtx']) + t.extra_data = raw[-extra_data_len:] + return t def smartbit_tx(url, rawdata=False): @@ -96,3 +107,10 @@ class TXAPISegnet(object): def get_tx(self, txhash): url = 'https://segnet-api.smartbit.com.au/v1/blockchain/tx/%s' % txhash.decode('ascii') return smartbit_tx(url) + +class TXAPIZcashTestnet(object): + + # @filecache(DAY) + def get_tx(self, txhash): + url = 'https://explorer.testnet.z.cash/api/tx/%s' % txhash.decode('ascii') + return insight_tx(url, zcash=True) diff --git a/trezorlib/types_pb2.py b/trezorlib/types_pb2.py index f83817282..c8454e90a 100644 --- a/trezorlib/types_pb2.py +++ b/trezorlib/types_pb2.py @@ -20,7 +20,7 @@ import google.protobuf.descriptor_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='types.proto', package='', - serialized_pb=_b('\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\x0eHDNodePathType\x12\x19\n\x04node\x18\x01 \x02(\x0b\x32\x0b.HDNodeType\x12\x11\n\taddress_n\x18\x02 \x03(\r\"\xdd\x01\n\x08\x43oinType\x12\x11\n\tcoin_name\x18\x01 \x01(\t\x12\x15\n\rcoin_shortcut\x18\x02 \x01(\t\x12\x17\n\x0c\x61\x64\x64ress_type\x18\x03 \x01(\r:\x01\x30\x12\x11\n\tmaxfee_kb\x18\x04 \x01(\x04\x12\x1c\n\x11\x61\x64\x64ress_type_p2sh\x18\x05 \x01(\r:\x01\x35\x12\x1e\n\x13\x61\x64\x64ress_type_p2wpkh\x18\x06 \x01(\r:\x01\x36\x12\x1e\n\x12\x61\x64\x64ress_type_p2wsh\x18\x07 \x01(\r:\x02\x31\x30\x12\x1d\n\x15signed_message_header\x18\x08 \x01(\t\"[\n\x18MultisigRedeemScriptType\x12 \n\x07pubkeys\x18\x01 \x03(\x0b\x32\x0f.HDNodePathType\x12\x12\n\nsignatures\x18\x02 \x03(\x0c\x12\t\n\x01m\x18\x03 \x01(\r\"\xeb\x01\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\x12\x33\n\x0bscript_type\x18\x06 \x01(\x0e\x32\x10.InputScriptType:\x0cSPENDADDRESS\x12+\n\x08multisig\x18\x07 \x01(\x0b\x32\x19.MultisigRedeemScriptType\x12\x0e\n\x06\x61mount\x18\x08 \x01(\x04\"\xaf\x01\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\x11.OutputScriptType\x12+\n\x08multisig\x18\x05 \x01(\x0b\x32\x19.MultisigRedeemScriptType\x12\x16\n\x0eop_return_data\x18\x06 \x01(\x0c\"8\n\x0fTxOutputBinType\x12\x0e\n\x06\x61mount\x18\x01 \x02(\x04\x12\x15\n\rscript_pubkey\x18\x02 \x02(\x0c\"\xc3\x01\n\x0fTransactionType\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x1c\n\x06inputs\x18\x02 \x03(\x0b\x32\x0c.TxInputType\x12%\n\x0b\x62in_outputs\x18\x03 \x03(\x0b\x32\x10.TxOutputBinType\x12\x1e\n\x07outputs\x18\x05 \x03(\x0b\x32\r.TxOutputType\x12\x11\n\tlock_time\x18\x04 \x01(\r\x12\x12\n\ninputs_cnt\x18\x06 \x01(\r\x12\x13\n\x0boutputs_cnt\x18\x07 \x01(\r\">\n\x14TxRequestDetailsType\x12\x15\n\rrequest_index\x18\x01 \x01(\r\x12\x0f\n\x07tx_hash\x18\x02 \x01(\x0c\"\\\n\x17TxRequestSerializedType\x12\x17\n\x0fsignature_index\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x15\n\rserialized_tx\x18\x03 \x01(\x0c\"g\n\x0cIdentityType\x12\r\n\x05proto\x18\x01 \x01(\t\x12\x0c\n\x04user\x18\x02 \x01(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x0c\n\x04port\x18\x04 \x01(\t\x12\x0c\n\x04path\x18\x05 \x01(\t\x12\x10\n\x05index\x18\x06 \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*\x87\x01\n\x10OutputScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01\x12\x11\n\rPAYTOMULTISIG\x10\x02\x12\x11\n\rPAYTOOPRETURN\x10\x03\x12\x10\n\x0cPAYTOWITNESS\x10\x04\x12\x14\n\x10PAYTOP2SHWITNESS\x10\x05*l\n\x0fInputScriptType\x12\x10\n\x0cSPENDADDRESS\x10\x00\x12\x11\n\rSPENDMULTISIG\x10\x01\x12\x0c\n\x08\x45XTERNAL\x10\x02\x12\x10\n\x0cSPENDWITNESS\x10\x03\x12\x14\n\x10SPENDP2SHWITNESS\x10\x04*D\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\x00\x12\x0c\n\x08TXOUTPUT\x10\x01\x12\n\n\x06TXMETA\x10\x02\x12\x0e\n\nTXFINISHED\x10\x03*\xdf\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\x12\x1f\n\x1b\x42uttonRequest_FirmwareCheck\x10\t\x12\x19\n\x15\x42uttonRequest_Address\x10\n\x12\x1b\n\x17\x42uttonRequest_PublicKey\x10\x0b*\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-\n\x1f\x63om.satoshilabs.trezor.protobufB\nTrezorType') + serialized_pb=_b('\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\x0eHDNodePathType\x12\x19\n\x04node\x18\x01 \x02(\x0b\x32\x0b.HDNodeType\x12\x11\n\taddress_n\x18\x02 \x03(\r\"\xdd\x01\n\x08\x43oinType\x12\x11\n\tcoin_name\x18\x01 \x01(\t\x12\x15\n\rcoin_shortcut\x18\x02 \x01(\t\x12\x17\n\x0c\x61\x64\x64ress_type\x18\x03 \x01(\r:\x01\x30\x12\x11\n\tmaxfee_kb\x18\x04 \x01(\x04\x12\x1c\n\x11\x61\x64\x64ress_type_p2sh\x18\x05 \x01(\r:\x01\x35\x12\x1e\n\x13\x61\x64\x64ress_type_p2wpkh\x18\x06 \x01(\r:\x01\x36\x12\x1e\n\x12\x61\x64\x64ress_type_p2wsh\x18\x07 \x01(\r:\x02\x31\x30\x12\x1d\n\x15signed_message_header\x18\x08 \x01(\t\"[\n\x18MultisigRedeemScriptType\x12 \n\x07pubkeys\x18\x01 \x03(\x0b\x32\x0f.HDNodePathType\x12\x12\n\nsignatures\x18\x02 \x03(\x0c\x12\t\n\x01m\x18\x03 \x01(\r\"\xeb\x01\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\x12\x33\n\x0bscript_type\x18\x06 \x01(\x0e\x32\x10.InputScriptType:\x0cSPENDADDRESS\x12+\n\x08multisig\x18\x07 \x01(\x0b\x32\x19.MultisigRedeemScriptType\x12\x0e\n\x06\x61mount\x18\x08 \x01(\x04\"\xaf\x01\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\x11.OutputScriptType\x12+\n\x08multisig\x18\x05 \x01(\x0b\x32\x19.MultisigRedeemScriptType\x12\x16\n\x0eop_return_data\x18\x06 \x01(\x0c\"8\n\x0fTxOutputBinType\x12\x0e\n\x06\x61mount\x18\x01 \x02(\x04\x12\x15\n\rscript_pubkey\x18\x02 \x02(\x0c\"\xef\x01\n\x0fTransactionType\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x1c\n\x06inputs\x18\x02 \x03(\x0b\x32\x0c.TxInputType\x12%\n\x0b\x62in_outputs\x18\x03 \x03(\x0b\x32\x10.TxOutputBinType\x12\x1e\n\x07outputs\x18\x05 \x03(\x0b\x32\r.TxOutputType\x12\x11\n\tlock_time\x18\x04 \x01(\r\x12\x12\n\ninputs_cnt\x18\x06 \x01(\r\x12\x13\n\x0boutputs_cnt\x18\x07 \x01(\r\x12\x12\n\nextra_data\x18\x08 \x01(\x0c\x12\x16\n\x0e\x65xtra_data_len\x18\t \x01(\r\"q\n\x14TxRequestDetailsType\x12\x15\n\rrequest_index\x18\x01 \x01(\r\x12\x0f\n\x07tx_hash\x18\x02 \x01(\x0c\x12\x16\n\x0e\x65xtra_data_len\x18\x03 \x01(\r\x12\x19\n\x11\x65xtra_data_offset\x18\x04 \x01(\r\"\\\n\x17TxRequestSerializedType\x12\x17\n\x0fsignature_index\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x15\n\rserialized_tx\x18\x03 \x01(\x0c\"g\n\x0cIdentityType\x12\r\n\x05proto\x18\x01 \x01(\t\x12\x0c\n\x04user\x18\x02 \x01(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x0c\n\x04port\x18\x04 \x01(\t\x12\x0c\n\x04path\x18\x05 \x01(\t\x12\x10\n\x05index\x18\x06 \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*\x87\x01\n\x10OutputScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01\x12\x11\n\rPAYTOMULTISIG\x10\x02\x12\x11\n\rPAYTOOPRETURN\x10\x03\x12\x10\n\x0cPAYTOWITNESS\x10\x04\x12\x14\n\x10PAYTOP2SHWITNESS\x10\x05*l\n\x0fInputScriptType\x12\x10\n\x0cSPENDADDRESS\x10\x00\x12\x11\n\rSPENDMULTISIG\x10\x01\x12\x0c\n\x08\x45XTERNAL\x10\x02\x12\x10\n\x0cSPENDWITNESS\x10\x03\x12\x14\n\x10SPENDP2SHWITNESS\x10\x04*U\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\x00\x12\x0c\n\x08TXOUTPUT\x10\x01\x12\n\n\x06TXMETA\x10\x02\x12\x0e\n\nTXFINISHED\x10\x03\x12\x0f\n\x0bTXEXTRADATA\x10\x04*\xdf\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\x12\x1f\n\x1b\x42uttonRequest_FirmwareCheck\x10\t\x12\x19\n\x15\x42uttonRequest_Address\x10\n\x12\x1b\n\x17\x42uttonRequest_PublicKey\x10\x0b*\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-\n\x1f\x63om.satoshilabs.trezor.protobufB\nTrezorType') , dependencies=[google.protobuf.descriptor_pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -82,8 +82,8 @@ _FAILURETYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1497, - serialized_end=1830, + serialized_start=1592, + serialized_end=1925, ) _sym_db.RegisterEnumDescriptor(_FAILURETYPE) @@ -121,8 +121,8 @@ _OUTPUTSCRIPTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1833, - serialized_end=1968, + serialized_start=1928, + serialized_end=2063, ) _sym_db.RegisterEnumDescriptor(_OUTPUTSCRIPTTYPE) @@ -156,8 +156,8 @@ _INPUTSCRIPTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1970, - serialized_end=2078, + serialized_start=2065, + serialized_end=2173, ) _sym_db.RegisterEnumDescriptor(_INPUTSCRIPTTYPE) @@ -184,11 +184,15 @@ _REQUESTTYPE = _descriptor.EnumDescriptor( name='TXFINISHED', index=3, number=3, options=None, type=None), + _descriptor.EnumValueDescriptor( + name='TXEXTRADATA', index=4, number=4, + options=None, + type=None), ], containing_type=None, options=None, - serialized_start=2080, - serialized_end=2148, + serialized_start=2175, + serialized_end=2260, ) _sym_db.RegisterEnumDescriptor(_REQUESTTYPE) @@ -246,8 +250,8 @@ _BUTTONREQUESTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=2151, - serialized_end=2502, + serialized_start=2263, + serialized_end=2614, ) _sym_db.RegisterEnumDescriptor(_BUTTONREQUESTTYPE) @@ -273,8 +277,8 @@ _PINMATRIXREQUESTTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=2504, - serialized_end=2631, + serialized_start=2616, + serialized_end=2743, ) _sym_db.RegisterEnumDescriptor(_PINMATRIXREQUESTTYPE) @@ -306,6 +310,7 @@ TXINPUT = 0 TXOUTPUT = 1 TXMETA = 2 TXFINISHED = 3 +TXEXTRADATA = 4 ButtonRequest_Other = 1 ButtonRequest_FeeOverThreshold = 2 ButtonRequest_ConfirmOutput = 3 @@ -817,6 +822,20 @@ _TRANSACTIONTYPE = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='extra_data', full_name='TransactionType.extra_data', index=7, + number=8, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='extra_data_len', full_name='TransactionType.extra_data_len', index=8, + number=9, 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), ], extensions=[ ], @@ -829,7 +848,7 @@ _TRANSACTIONTYPE = _descriptor.Descriptor( oneofs=[ ], serialized_start=1036, - serialized_end=1231, + serialized_end=1275, ) @@ -854,6 +873,20 @@ _TXREQUESTDETAILSTYPE = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='extra_data_len', full_name='TxRequestDetailsType.extra_data_len', 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, + options=None), + _descriptor.FieldDescriptor( + name='extra_data_offset', full_name='TxRequestDetailsType.extra_data_offset', index=3, + number=4, 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), ], extensions=[ ], @@ -865,8 +898,8 @@ _TXREQUESTDETAILSTYPE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1233, - serialized_end=1295, + serialized_start=1277, + serialized_end=1390, ) @@ -909,8 +942,8 @@ _TXREQUESTSERIALIZEDTYPE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1297, - serialized_end=1389, + serialized_start=1392, + serialized_end=1484, ) @@ -974,8 +1007,8 @@ _IDENTITYTYPE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1391, - serialized_end=1494, + serialized_start=1486, + serialized_end=1589, ) _HDNODEPATHTYPE.fields_by_name['node'].message_type = _HDNODETYPE