diff --git a/tools/build_protobuf b/tools/build_protobuf index 867d48ac4b..04ddc9824b 100755 --- a/tools/build_protobuf +++ b/tools/build_protobuf @@ -1,32 +1,32 @@ #!/bin/bash -CURDIR=$(pwd) -PB2DIR=$CURDIR/pb2 -OUTDIR=../trezorlib/messages -INDEX=$OUTDIR/__init__.py +set -e -rm -f $OUTDIR/[A-Z]*.py -mkdir -p $OUTDIR -mkdir -p $PB2DIR -touch $PB2DIR/__init__.py +cd "$(dirname "$0")" -rm -f $INDEX -echo '# Automatically generated by pb2py' >> $INDEX -echo 'from __future__ import absolute_import' >> $INDEX -echo '' >> $INDEX +GENPATH="../trezorlib/messages" +INDEX="$GENPATH/__init__.py" +PROTO_PATH="../../trezor-common/protob" +PROTO_FILES="types messages" +PB2_OUT="pb2" -for i in types messages ; do +rm -f "$GENPATH/[A-Z]*.py" +mkdir -p "$GENPATH" + +cat > "$INDEX" << EOF +# Automatically generated by pb2py + +EOF + +mkdir -p "$PB2_OUT" + +for file in $PROTO_FILES; do # Compile .proto files to python2 modules using google protobuf library - cd $CURDIR/../../trezor-common/protob - protoc --python_out=$PB2DIR -I/usr/include -I. $i.proto + protoc --python_out="$PB2_OUT" -I/usr/include -I"$PROTO_PATH" "$PROTO_PATH/$file.proto" done -# hack to make output python 3 compatible -sed -i 's/^import types_pb2/from . import types_pb2/g' $CURDIR/pb2/messages_pb2.py - -for i in types messages ; do +for file in $PROTO_FILES; do # Convert google protobuf library to trezor's internal format - cd $CURDIR - ./pb2py -p $CURDIR -l $INDEX $i $OUTDIR + ./pb2py -P "trezorlib.protobuf" -p "$PB2_OUT" -l "$INDEX" "$file" "$GENPATH" done -rm -rf $PB2DIR +rm -rf "$PB2_OUT" diff --git a/tools/pb2py b/tools/pb2py index 50d7cebc7c..3cda885686 100755 --- a/tools/pb2py +++ b/tools/pb2py @@ -3,72 +3,78 @@ # to plain-python objects as used in TREZOR Core and python-trezor import sys +import importlib import os import argparse -from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper + +def import_pb2(name): + return importlib.import_module("%s_pb2" % name) -def process_type(t, cls, msg_id, indexfile, is_upy): - print(" * type %s" % t) +def create_message_import(name): + return "from .%s import %s" % (name, name) + + +def create_const(name, value, is_upy): + if is_upy: + return "%s = const(%s)" % (name, value) + else: + return "%s = %s" % (name, value) + + +def remove_from_start(s, prefix): + if s.startswith(prefix): + return s[len(prefix):] + else: + return s + + +def process_message(descriptor, protobuf_module, msg_id, indexfile, is_upy): + print(" * type %s" % descriptor.name) imports = [] - out = ["", "", "class %s(p.MessageType):" % t, ] + out = ["", "", "class %s(p.MessageType):" % descriptor.name, ] - if cls.DESCRIPTOR.fields_by_name: + if descriptor.fields_by_number: out.append(" FIELDS = {") elif msg_id is None: out.append(" pass") - for v in sorted(cls.DESCRIPTOR.fields_by_name.values(), key=lambda x: x.number): - number = v.number - fieldname = v.name - type = None - repeated = v.label == 3 - required = v.label == 2 + for number, field in descriptor.fields_by_number.items(): + field_name = field.name + field_type = None + repeated = (field.label == field.LABEL_REPEATED) + required = (field.label == field.LABEL_REQUIRED) - # print v.has_default_value, v.default_value - - if v.type in (4, 13, 14): - # TYPE_UINT64 = 4 - # TYPE_UINT32 = 13 - # TYPE_ENUM = 14 - type = 'p.UVarintType' - - elif v.type in (17,): - # TYPE_SINT32 = 17 - type = 'p.Sint32Type' - - elif v.type in (18,): - # TYPE_SINT64 = 18 - type = 'p.Sint64Type' - - elif v.type == 9: - # TYPE_STRING = 9 - type = 'p.UnicodeType' - - elif v.type == 8: - # TYPE_BOOL = 8 - type = 'p.BoolType' - - elif v.type == 12: - # TYPE_BYTES = 12 - type = 'p.BytesType' - - elif v.type == 11: - # TYPE_MESSAGE = 1 - type = v.message_type.name - imports.append("from .%s import %s" % - (v.message_type.name, v.message_type.name)) + types = { + field.TYPE_UINT64: 'p.UVarintType', + field.TYPE_UINT32: 'p.UVarintType', + field.TYPE_ENUM: 'p.UVarintType', + field.TYPE_SINT32: 'p.Sint32Type', + field.TYPE_SINT64: 'p.Sint64Type', + field.TYPE_STRING: 'p.UnicodeType', + field.TYPE_BOOL: 'p.BoolType', + field.TYPE_BYTES: 'p.BytesType' + } + if field.type == field.TYPE_MESSAGE: + field_type = field.message_type.name + imports.append(create_message_import(field_type)) else: - raise Exception("Unknown field type %s for field %s" % - (v.type, fieldname)) + try: + field_type = types[field.type] + except KeyError: + raise ValueError("Unknown field type %d for field %s" % (field.type, field_name)) + comments = [] if required: - comment = ' # required' - elif v.has_default_value: - comment = ' # default=%s' % repr(v.default_value) + comments.append('required') + if field.has_default_value: + comments.append("default=%s" % repr(field.default_value)) + + if comments: + comment = " # %s" % ' '.join(comments) else: comment = '' @@ -78,27 +84,15 @@ def process_type(t, cls, msg_id, indexfile, is_upy): flags = '0' out.append(" %d: ('%s', %s, %s),%s" % - (number, fieldname, type, flags, comment)) + (number, field_name, field_type, flags, comment)) - # print fieldname, number, type, repeated, comment - # print v.__dict__ - # print v.CPPTYPE_STRING - # print v.LABEL_REPEATED - # print v.enum_type - # v.has_default_value, v.default_value - # v.label == 3 # repeated - # print v.number - - if cls.DESCRIPTOR.fields_by_name: + if descriptor.fields_by_name: out.append(" }") if msg_id is not None: out.append(" MESSAGE_WIRE_TYPE = %d" % msg_id) if indexfile is not None: - if is_upy: - indexfile.write("%s = const(%d)\n" % (t, msg_id)) - else: - indexfile.write("%s = %d\n" % (t, msg_id)) + indexfile.write(create_const(t, msg_id, is_upy)) # Remove duplicate imports imports = sorted(list(set(imports))) @@ -106,73 +100,60 @@ def process_type(t, cls, msg_id, indexfile, is_upy): if is_upy: imports = ['import protobuf as p'] + imports else: - imports = ['from __future__ import absolute_import', - 'from .. import protobuf as p'] + imports + imports = ['from .. import protobuf as p'] + imports return imports + out -def process_enum(t, cls, is_upy): +def process_enum(descriptor, is_upy): out = [] if is_upy: out += ("from micropython import const", "") - print(" * enum %s" % t) + print(" * enum %s" % descriptor.name) - for k, v in cls.items(): + for name, value in descriptor.values_by_name.items(): # Remove type name from the beginning of the constant # For example "PinMatrixRequestType_Current" -> "Current" - if k.startswith("%s_" % t): - k = k.replace("%s_" % t, '') + enum_prefix = descriptor.name + name = remove_from_start(name, "%s_" % enum_prefix) # If type ends with *Type, but constant use type name without *Type, remove it too :) # For example "ButtonRequestType & ButtonRequest_Other" => "Other" - if t.endswith("Type") and k.startswith("%s_" % t.replace("Type", '')): - k = k.replace("%s_" % t.replace("Type", ''), '') + if enum_prefix.endswith("Type"): + enum_prefix, _ = enum_prefix.rsplit("Type", 1) + name = remove_from_start(name, "%s_" % enum_prefix) - if is_upy: - out.append("%s = const(%s)" % (k, v)) - else: - out.append("%s = %s" % (k, v)) + out.append(create_const(name, value.number, is_upy)) return out -def find_msg_type(msg_types, t): - for k, v in msg_types: - msg_name = k.replace('MessageType_', '') - if msg_name == t: - return v +def process_file(descriptor, protobuf_module, genpath, indexfile, modlist, is_upy): + print("Processing module %s" % descriptor.name) -def process_module(mod, genpath, indexfile, modlist, is_upy): + msg_types = import_pb2('messages').MessageType - print("Processing module %s" % mod.__name__) - types = dict([(name, cls) - for name, cls in mod.__dict__.items() if isinstance(cls, type)]) - - msg_types = __import__('pb2', globals(), locals(), [ - 'messages_pb2', ]).messages_pb2.MessageType.items() - - for t, cls in sorted(types.items()): + for name, message_descriptor in sorted(descriptor.message_types_by_name.items()): # Find message type for given class - msg_id = find_msg_type(msg_types, t) + try: + msg_id = msg_types.Value("MessageType_%s" % name) + except ValueError: + msg_id = None - out = process_type(t, cls, msg_id, indexfile, is_upy) + out = process_message(message_descriptor, protobuf_module, msg_id, indexfile, is_upy) - write_to_file(genpath, t, out) + write_to_file(genpath, name, out) if modlist: - modlist.write("from .%s import *\n" % t) + modlist.write(create_message_import(name) + "\n") - enums = dict([(name, cls) for name, cls in mod.__dict__.items() - if isinstance(cls, EnumTypeWrapper)]) - - for t, cls in enums.items(): - out = process_enum(t, cls, is_upy) - write_to_file(genpath, t, out) + for name, enum_descriptor in descriptor.enum_types_by_name.items(): + out = process_enum(enum_descriptor, is_upy) + write_to_file(genpath, name, out) if modlist: - modlist.write("from . import %s\n" % t) + modlist.write("from . import %s\n" % name) def write_to_file(genpath, t, out): @@ -188,29 +169,19 @@ def write_to_file(genpath, t, out): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('modulename', type=str, help="Name of module to generate") - parser.add_argument('genpath', type=str, help="Directory for generated source code") - parser.add_argument('-i', '--indexfile', type=str, help="[optional] Generate index file of wire types") - parser.add_argument('-l', '--modlist', type=str, help="[optional] Generate list of modules") - parser.add_argument('-p', '--protopath', type=str, help="[optional] Path to search for pregenerated Google's python sources") + parser.add_argument('module', help="Name of module to generate") + parser.add_argument('genpath', help="Directory for generated source code") + parser.add_argument('-P', '--protobuf-module', default="protobuf", help="Name of protobuf module") + parser.add_argument('-i', '--indexfile', type=argparse.FileType('a'), help="Generate index file of wire types") + parser.add_argument('-l', '--modlist', type=argparse.FileType('a'), help="Generate list of modules") + parser.add_argument('-p', '--protopath', type=str, help="Path to search for pregenerated Google's python sources") parser.add_argument('-m', '--micropython', action='store_true', help="Use micropython-favoured source code") args = parser.parse_args() - if args.indexfile: - indexfile = open(args.indexfile, 'a') - else: - indexfile = None - - if args.modlist: - modlist = open(args.modlist, 'a') - else: - modlist = None - if args.protopath: sys.path.append(args.protopath) - # Dynamically load module from argv[1] - tmp = __import__('pb2', globals(), locals(), ['%s_pb2' % args.modulename]) - mod = getattr(tmp, "%s_pb2" % args.modulename) + # This must be done after sys.path.append + module = import_pb2(args.module) - process_module(mod, args.genpath, indexfile, modlist, args.micropython) + process_file(module.DESCRIPTOR, args.protobuf_module, args.genpath, args.indexfile, args.modlist, args.micropython) diff --git a/trezorlib/messages/Address.py b/trezorlib/messages/Address.py index ea6e18c89d..506935c115 100644 --- a/trezorlib/messages/Address.py +++ b/trezorlib/messages/Address.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ApplyFlags.py b/trezorlib/messages/ApplyFlags.py index 2055f9a56e..f4163862b3 100644 --- a/trezorlib/messages/ApplyFlags.py +++ b/trezorlib/messages/ApplyFlags.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ApplySettings.py b/trezorlib/messages/ApplySettings.py index 0c95e943e9..3d836642a7 100644 --- a/trezorlib/messages/ApplySettings.py +++ b/trezorlib/messages/ApplySettings.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/BackupDevice.py b/trezorlib/messages/BackupDevice.py index 93ae5de096..aa26960048 100644 --- a/trezorlib/messages/BackupDevice.py +++ b/trezorlib/messages/BackupDevice.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ButtonAck.py b/trezorlib/messages/ButtonAck.py index 106128c81f..f777ddc959 100644 --- a/trezorlib/messages/ButtonAck.py +++ b/trezorlib/messages/ButtonAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ButtonRequest.py b/trezorlib/messages/ButtonRequest.py index 4755003492..56cbca2515 100644 --- a/trezorlib/messages/ButtonRequest.py +++ b/trezorlib/messages/ButtonRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Cancel.py b/trezorlib/messages/Cancel.py index 1d4b0e9451..0525f1365f 100644 --- a/trezorlib/messages/Cancel.py +++ b/trezorlib/messages/Cancel.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ChangePin.py b/trezorlib/messages/ChangePin.py index 6be334390a..217a84a738 100644 --- a/trezorlib/messages/ChangePin.py +++ b/trezorlib/messages/ChangePin.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CipherKeyValue.py b/trezorlib/messages/CipherKeyValue.py index f32f26fa37..2673b5be0b 100644 --- a/trezorlib/messages/CipherKeyValue.py +++ b/trezorlib/messages/CipherKeyValue.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CipheredKeyValue.py b/trezorlib/messages/CipheredKeyValue.py index 5b9f0d44df..3db46014e9 100644 --- a/trezorlib/messages/CipheredKeyValue.py +++ b/trezorlib/messages/CipheredKeyValue.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ClearSession.py b/trezorlib/messages/ClearSession.py index 33ff5fbb9a..8a01f77024 100644 --- a/trezorlib/messages/ClearSession.py +++ b/trezorlib/messages/ClearSession.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CoinType.py b/trezorlib/messages/CoinType.py index 9e225d2eba..7fcd9aaf10 100644 --- a/trezorlib/messages/CoinType.py +++ b/trezorlib/messages/CoinType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CosiCommit.py b/trezorlib/messages/CosiCommit.py index 77f023476e..ac8b318aab 100644 --- a/trezorlib/messages/CosiCommit.py +++ b/trezorlib/messages/CosiCommit.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CosiCommitment.py b/trezorlib/messages/CosiCommitment.py index 26ae7b994a..652319f13a 100644 --- a/trezorlib/messages/CosiCommitment.py +++ b/trezorlib/messages/CosiCommitment.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CosiSign.py b/trezorlib/messages/CosiSign.py index 2215af6b37..78a6996b58 100644 --- a/trezorlib/messages/CosiSign.py +++ b/trezorlib/messages/CosiSign.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/CosiSignature.py b/trezorlib/messages/CosiSignature.py index 1fcddd784f..3716165228 100644 --- a/trezorlib/messages/CosiSignature.py +++ b/trezorlib/messages/CosiSignature.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkDecision.py b/trezorlib/messages/DebugLinkDecision.py index 4cd92c2702..482d886c6a 100644 --- a/trezorlib/messages/DebugLinkDecision.py +++ b/trezorlib/messages/DebugLinkDecision.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkFlashErase.py b/trezorlib/messages/DebugLinkFlashErase.py index ef937afa03..405443a01f 100644 --- a/trezorlib/messages/DebugLinkFlashErase.py +++ b/trezorlib/messages/DebugLinkFlashErase.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkGetState.py b/trezorlib/messages/DebugLinkGetState.py index 9b1946052f..c8a3130b1e 100644 --- a/trezorlib/messages/DebugLinkGetState.py +++ b/trezorlib/messages/DebugLinkGetState.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkLog.py b/trezorlib/messages/DebugLinkLog.py index 7ca0a8cd8c..5ab46fa19b 100644 --- a/trezorlib/messages/DebugLinkLog.py +++ b/trezorlib/messages/DebugLinkLog.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkMemory.py b/trezorlib/messages/DebugLinkMemory.py index 5fbc0936b0..5ef79e57f7 100644 --- a/trezorlib/messages/DebugLinkMemory.py +++ b/trezorlib/messages/DebugLinkMemory.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkMemoryRead.py b/trezorlib/messages/DebugLinkMemoryRead.py index c6d4a49f1a..b2ebb2574f 100644 --- a/trezorlib/messages/DebugLinkMemoryRead.py +++ b/trezorlib/messages/DebugLinkMemoryRead.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkMemoryWrite.py b/trezorlib/messages/DebugLinkMemoryWrite.py index 92cbe3089a..3b72652676 100644 --- a/trezorlib/messages/DebugLinkMemoryWrite.py +++ b/trezorlib/messages/DebugLinkMemoryWrite.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DebugLinkState.py b/trezorlib/messages/DebugLinkState.py index 4ac2e0797d..9438fe8c3a 100644 --- a/trezorlib/messages/DebugLinkState.py +++ b/trezorlib/messages/DebugLinkState.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .HDNodeType import HDNodeType diff --git a/trezorlib/messages/DebugLinkStop.py b/trezorlib/messages/DebugLinkStop.py index 46baffd1f9..a0e09d9d51 100644 --- a/trezorlib/messages/DebugLinkStop.py +++ b/trezorlib/messages/DebugLinkStop.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DecryptMessage.py b/trezorlib/messages/DecryptMessage.py index 0158c5cb21..f37d679a08 100644 --- a/trezorlib/messages/DecryptMessage.py +++ b/trezorlib/messages/DecryptMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/DecryptedMessage.py b/trezorlib/messages/DecryptedMessage.py index 4beb097065..d8917295c4 100644 --- a/trezorlib/messages/DecryptedMessage.py +++ b/trezorlib/messages/DecryptedMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ECDHSessionKey.py b/trezorlib/messages/ECDHSessionKey.py index ef9f1cb602..aa8cc8272c 100644 --- a/trezorlib/messages/ECDHSessionKey.py +++ b/trezorlib/messages/ECDHSessionKey.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EncryptMessage.py b/trezorlib/messages/EncryptMessage.py index b1c2822799..1be5c963bc 100644 --- a/trezorlib/messages/EncryptMessage.py +++ b/trezorlib/messages/EncryptMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EncryptedMessage.py b/trezorlib/messages/EncryptedMessage.py index 214d7806de..131a356371 100644 --- a/trezorlib/messages/EncryptedMessage.py +++ b/trezorlib/messages/EncryptedMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Entropy.py b/trezorlib/messages/Entropy.py index 3fa4396e96..0a828f9521 100644 --- a/trezorlib/messages/Entropy.py +++ b/trezorlib/messages/Entropy.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EntropyAck.py b/trezorlib/messages/EntropyAck.py index 3c57de058e..2050865c7a 100644 --- a/trezorlib/messages/EntropyAck.py +++ b/trezorlib/messages/EntropyAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EntropyRequest.py b/trezorlib/messages/EntropyRequest.py index 99501e9272..f68fdd7bd3 100644 --- a/trezorlib/messages/EntropyRequest.py +++ b/trezorlib/messages/EntropyRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EstimateTxSize.py b/trezorlib/messages/EstimateTxSize.py index dbad692a83..889ca9f236 100644 --- a/trezorlib/messages/EstimateTxSize.py +++ b/trezorlib/messages/EstimateTxSize.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumAddress.py b/trezorlib/messages/EthereumAddress.py index f07e5a0130..1a1e9962a8 100644 --- a/trezorlib/messages/EthereumAddress.py +++ b/trezorlib/messages/EthereumAddress.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumGetAddress.py b/trezorlib/messages/EthereumGetAddress.py index 8301c2508c..99a6551918 100644 --- a/trezorlib/messages/EthereumGetAddress.py +++ b/trezorlib/messages/EthereumGetAddress.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumMessageSignature.py b/trezorlib/messages/EthereumMessageSignature.py index 69ae44d9f0..ff0923865a 100644 --- a/trezorlib/messages/EthereumMessageSignature.py +++ b/trezorlib/messages/EthereumMessageSignature.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumSignMessage.py b/trezorlib/messages/EthereumSignMessage.py index 1eb63ab58c..09dfbe8a99 100644 --- a/trezorlib/messages/EthereumSignMessage.py +++ b/trezorlib/messages/EthereumSignMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumSignTx.py b/trezorlib/messages/EthereumSignTx.py index 819a7749b5..92426c41c1 100644 --- a/trezorlib/messages/EthereumSignTx.py +++ b/trezorlib/messages/EthereumSignTx.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumTxAck.py b/trezorlib/messages/EthereumTxAck.py index 7f7db90027..9a6b62d860 100644 --- a/trezorlib/messages/EthereumTxAck.py +++ b/trezorlib/messages/EthereumTxAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumTxRequest.py b/trezorlib/messages/EthereumTxRequest.py index 9d3a328ecb..e4c59cfe48 100644 --- a/trezorlib/messages/EthereumTxRequest.py +++ b/trezorlib/messages/EthereumTxRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/EthereumVerifyMessage.py b/trezorlib/messages/EthereumVerifyMessage.py index 111b6fe026..25481338fc 100644 --- a/trezorlib/messages/EthereumVerifyMessage.py +++ b/trezorlib/messages/EthereumVerifyMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Failure.py b/trezorlib/messages/Failure.py index 5187d28dcf..9a752029a4 100644 --- a/trezorlib/messages/Failure.py +++ b/trezorlib/messages/Failure.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Features.py b/trezorlib/messages/Features.py index 32011caded..d1eaaa39a9 100644 --- a/trezorlib/messages/Features.py +++ b/trezorlib/messages/Features.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .CoinType import CoinType diff --git a/trezorlib/messages/FirmwareErase.py b/trezorlib/messages/FirmwareErase.py index 2cc4279bc1..7971b7583b 100644 --- a/trezorlib/messages/FirmwareErase.py +++ b/trezorlib/messages/FirmwareErase.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/FirmwareRequest.py b/trezorlib/messages/FirmwareRequest.py index 7792f082f5..cb766771b1 100644 --- a/trezorlib/messages/FirmwareRequest.py +++ b/trezorlib/messages/FirmwareRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/FirmwareUpload.py b/trezorlib/messages/FirmwareUpload.py index 1c41150a0b..3c726a76b3 100644 --- a/trezorlib/messages/FirmwareUpload.py +++ b/trezorlib/messages/FirmwareUpload.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/GetAddress.py b/trezorlib/messages/GetAddress.py index 792196d3f3..a0dd174fa2 100644 --- a/trezorlib/messages/GetAddress.py +++ b/trezorlib/messages/GetAddress.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType diff --git a/trezorlib/messages/GetECDHSessionKey.py b/trezorlib/messages/GetECDHSessionKey.py index f752caae10..e9f943997a 100644 --- a/trezorlib/messages/GetECDHSessionKey.py +++ b/trezorlib/messages/GetECDHSessionKey.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .IdentityType import IdentityType diff --git a/trezorlib/messages/GetEntropy.py b/trezorlib/messages/GetEntropy.py index 724e62591c..e16043b692 100644 --- a/trezorlib/messages/GetEntropy.py +++ b/trezorlib/messages/GetEntropy.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/GetFeatures.py b/trezorlib/messages/GetFeatures.py index ea1fbd2e45..3e5f17f24b 100644 --- a/trezorlib/messages/GetFeatures.py +++ b/trezorlib/messages/GetFeatures.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/GetPublicKey.py b/trezorlib/messages/GetPublicKey.py index 8a605b29f4..b89881aa58 100644 --- a/trezorlib/messages/GetPublicKey.py +++ b/trezorlib/messages/GetPublicKey.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/HDNodePathType.py b/trezorlib/messages/HDNodePathType.py index 0c02c10fc8..720d41c3d3 100644 --- a/trezorlib/messages/HDNodePathType.py +++ b/trezorlib/messages/HDNodePathType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .HDNodeType import HDNodeType diff --git a/trezorlib/messages/HDNodeType.py b/trezorlib/messages/HDNodeType.py index a86d39111c..5bd2ed08bc 100644 --- a/trezorlib/messages/HDNodeType.py +++ b/trezorlib/messages/HDNodeType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/IdentityType.py b/trezorlib/messages/IdentityType.py index ac702050cb..e571d603b4 100644 --- a/trezorlib/messages/IdentityType.py +++ b/trezorlib/messages/IdentityType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Initialize.py b/trezorlib/messages/Initialize.py index 01d4e42069..7c816093a3 100644 --- a/trezorlib/messages/Initialize.py +++ b/trezorlib/messages/Initialize.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/LoadDevice.py b/trezorlib/messages/LoadDevice.py index 2aff877744..c5afb35b2e 100644 --- a/trezorlib/messages/LoadDevice.py +++ b/trezorlib/messages/LoadDevice.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .HDNodeType import HDNodeType diff --git a/trezorlib/messages/MessageSignature.py b/trezorlib/messages/MessageSignature.py index a4b7dc677a..fc1cad58c5 100644 --- a/trezorlib/messages/MessageSignature.py +++ b/trezorlib/messages/MessageSignature.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/MultisigRedeemScriptType.py b/trezorlib/messages/MultisigRedeemScriptType.py index 448475caeb..e818448f53 100644 --- a/trezorlib/messages/MultisigRedeemScriptType.py +++ b/trezorlib/messages/MultisigRedeemScriptType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .HDNodePathType import HDNodePathType diff --git a/trezorlib/messages/NEMAddress.py b/trezorlib/messages/NEMAddress.py index be2dcfadef..013b75db06 100644 --- a/trezorlib/messages/NEMAddress.py +++ b/trezorlib/messages/NEMAddress.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMAggregateModification.py b/trezorlib/messages/NEMAggregateModification.py index 5ea4be116e..76465df4e8 100644 --- a/trezorlib/messages/NEMAggregateModification.py +++ b/trezorlib/messages/NEMAggregateModification.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .NEMCosignatoryModification import NEMCosignatoryModification diff --git a/trezorlib/messages/NEMCosignatoryModification.py b/trezorlib/messages/NEMCosignatoryModification.py index f088fdb8a4..dda8789eae 100644 --- a/trezorlib/messages/NEMCosignatoryModification.py +++ b/trezorlib/messages/NEMCosignatoryModification.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMDecryptMessage.py b/trezorlib/messages/NEMDecryptMessage.py index fad7b6cd9f..f077aaa421 100644 --- a/trezorlib/messages/NEMDecryptMessage.py +++ b/trezorlib/messages/NEMDecryptMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMDecryptedMessage.py b/trezorlib/messages/NEMDecryptedMessage.py index a282e2040a..551e773c72 100644 --- a/trezorlib/messages/NEMDecryptedMessage.py +++ b/trezorlib/messages/NEMDecryptedMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMGetAddress.py b/trezorlib/messages/NEMGetAddress.py index 64724f0736..55d89e149b 100644 --- a/trezorlib/messages/NEMGetAddress.py +++ b/trezorlib/messages/NEMGetAddress.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMImportanceTransfer.py b/trezorlib/messages/NEMImportanceTransfer.py index 9faee8bf2c..c7c4b7e219 100644 --- a/trezorlib/messages/NEMImportanceTransfer.py +++ b/trezorlib/messages/NEMImportanceTransfer.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMMosaic.py b/trezorlib/messages/NEMMosaic.py index 4e75a88658..08eeb96e2b 100644 --- a/trezorlib/messages/NEMMosaic.py +++ b/trezorlib/messages/NEMMosaic.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMMosaicCreation.py b/trezorlib/messages/NEMMosaicCreation.py index bde7e105c6..8913ff9f37 100644 --- a/trezorlib/messages/NEMMosaicCreation.py +++ b/trezorlib/messages/NEMMosaicCreation.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .NEMMosaicDefinition import NEMMosaicDefinition diff --git a/trezorlib/messages/NEMMosaicDefinition.py b/trezorlib/messages/NEMMosaicDefinition.py index 51e8ff8692..c57b20bf9f 100644 --- a/trezorlib/messages/NEMMosaicDefinition.py +++ b/trezorlib/messages/NEMMosaicDefinition.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMMosaicSupplyChange.py b/trezorlib/messages/NEMMosaicSupplyChange.py index fc60c34ab2..258200e572 100644 --- a/trezorlib/messages/NEMMosaicSupplyChange.py +++ b/trezorlib/messages/NEMMosaicSupplyChange.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMProvisionNamespace.py b/trezorlib/messages/NEMProvisionNamespace.py index c0186924b3..6388f4ab28 100644 --- a/trezorlib/messages/NEMProvisionNamespace.py +++ b/trezorlib/messages/NEMProvisionNamespace.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMSignTx.py b/trezorlib/messages/NEMSignTx.py index fac2293956..aec95e2eaa 100644 --- a/trezorlib/messages/NEMSignTx.py +++ b/trezorlib/messages/NEMSignTx.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .NEMAggregateModification import NEMAggregateModification from .NEMImportanceTransfer import NEMImportanceTransfer diff --git a/trezorlib/messages/NEMSignedTx.py b/trezorlib/messages/NEMSignedTx.py index db0de724a4..18eac40bb8 100644 --- a/trezorlib/messages/NEMSignedTx.py +++ b/trezorlib/messages/NEMSignedTx.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMTransactionCommon.py b/trezorlib/messages/NEMTransactionCommon.py index 58bfd2d68c..bab273d535 100644 --- a/trezorlib/messages/NEMTransactionCommon.py +++ b/trezorlib/messages/NEMTransactionCommon.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/NEMTransfer.py b/trezorlib/messages/NEMTransfer.py index b715842637..5bd3540d0b 100644 --- a/trezorlib/messages/NEMTransfer.py +++ b/trezorlib/messages/NEMTransfer.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .NEMMosaic import NEMMosaic diff --git a/trezorlib/messages/PassphraseAck.py b/trezorlib/messages/PassphraseAck.py index 4a6bf00d02..ae4b1bda1a 100644 --- a/trezorlib/messages/PassphraseAck.py +++ b/trezorlib/messages/PassphraseAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PassphraseRequest.py b/trezorlib/messages/PassphraseRequest.py index fca49794c8..2edd3695ea 100644 --- a/trezorlib/messages/PassphraseRequest.py +++ b/trezorlib/messages/PassphraseRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PassphraseStateAck.py b/trezorlib/messages/PassphraseStateAck.py index de6b246c45..9baba8dfaf 100644 --- a/trezorlib/messages/PassphraseStateAck.py +++ b/trezorlib/messages/PassphraseStateAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PassphraseStateRequest.py b/trezorlib/messages/PassphraseStateRequest.py index 7e8964f668..45dabaad4f 100644 --- a/trezorlib/messages/PassphraseStateRequest.py +++ b/trezorlib/messages/PassphraseStateRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PinMatrixAck.py b/trezorlib/messages/PinMatrixAck.py index a889417281..d47a449dba 100644 --- a/trezorlib/messages/PinMatrixAck.py +++ b/trezorlib/messages/PinMatrixAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PinMatrixRequest.py b/trezorlib/messages/PinMatrixRequest.py index b73a6af90e..3964b302b1 100644 --- a/trezorlib/messages/PinMatrixRequest.py +++ b/trezorlib/messages/PinMatrixRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/Ping.py b/trezorlib/messages/Ping.py index b1848789b4..b09a8c0ff9 100644 --- a/trezorlib/messages/Ping.py +++ b/trezorlib/messages/Ping.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/PublicKey.py b/trezorlib/messages/PublicKey.py index 8d3093509d..bbff5c8449 100644 --- a/trezorlib/messages/PublicKey.py +++ b/trezorlib/messages/PublicKey.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .HDNodeType import HDNodeType diff --git a/trezorlib/messages/RecoveryDevice.py b/trezorlib/messages/RecoveryDevice.py index a05f53e618..500bddd951 100644 --- a/trezorlib/messages/RecoveryDevice.py +++ b/trezorlib/messages/RecoveryDevice.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/ResetDevice.py b/trezorlib/messages/ResetDevice.py index 2ad6da9986..7231cb0410 100644 --- a/trezorlib/messages/ResetDevice.py +++ b/trezorlib/messages/ResetDevice.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SelfTest.py b/trezorlib/messages/SelfTest.py index c768cb0987..0f4099f29f 100644 --- a/trezorlib/messages/SelfTest.py +++ b/trezorlib/messages/SelfTest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SetU2FCounter.py b/trezorlib/messages/SetU2FCounter.py index 4b81813fad..9598c62a10 100644 --- a/trezorlib/messages/SetU2FCounter.py +++ b/trezorlib/messages/SetU2FCounter.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SignIdentity.py b/trezorlib/messages/SignIdentity.py index d45cf63b18..fbbcbdc4d8 100644 --- a/trezorlib/messages/SignIdentity.py +++ b/trezorlib/messages/SignIdentity.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .IdentityType import IdentityType diff --git a/trezorlib/messages/SignMessage.py b/trezorlib/messages/SignMessage.py index 3bfe731d25..dde1fdd2be 100644 --- a/trezorlib/messages/SignMessage.py +++ b/trezorlib/messages/SignMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SignTx.py b/trezorlib/messages/SignTx.py index 83849ca02f..e182ad19da 100644 --- a/trezorlib/messages/SignTx.py +++ b/trezorlib/messages/SignTx.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SignedIdentity.py b/trezorlib/messages/SignedIdentity.py index 0e3e264210..465b0c86c5 100644 --- a/trezorlib/messages/SignedIdentity.py +++ b/trezorlib/messages/SignedIdentity.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/SimpleSignTx.py b/trezorlib/messages/SimpleSignTx.py index a8d8d8c87e..b6ed29bde5 100644 --- a/trezorlib/messages/SimpleSignTx.py +++ b/trezorlib/messages/SimpleSignTx.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .TransactionType import TransactionType from .TxInputType import TxInputType diff --git a/trezorlib/messages/Success.py b/trezorlib/messages/Success.py index 0b3cc14294..a7f1872aa5 100644 --- a/trezorlib/messages/Success.py +++ b/trezorlib/messages/Success.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/TransactionType.py b/trezorlib/messages/TransactionType.py index 03ae17984a..d3207156d3 100644 --- a/trezorlib/messages/TransactionType.py +++ b/trezorlib/messages/TransactionType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .TxInputType import TxInputType from .TxOutputBinType import TxOutputBinType @@ -11,8 +10,8 @@ class TransactionType(p.MessageType): 1: ('version', p.UVarintType, 0), 2: ('inputs', TxInputType, p.FLAG_REPEATED), 3: ('bin_outputs', TxOutputBinType, p.FLAG_REPEATED), - 4: ('lock_time', p.UVarintType, 0), 5: ('outputs', TxOutputType, p.FLAG_REPEATED), + 4: ('lock_time', p.UVarintType, 0), 6: ('inputs_cnt', p.UVarintType, 0), 7: ('outputs_cnt', p.UVarintType, 0), 8: ('extra_data', p.BytesType, 0), diff --git a/trezorlib/messages/TxAck.py b/trezorlib/messages/TxAck.py index 47ebe4f5f4..0366e0ba57 100644 --- a/trezorlib/messages/TxAck.py +++ b/trezorlib/messages/TxAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .TransactionType import TransactionType diff --git a/trezorlib/messages/TxInputType.py b/trezorlib/messages/TxInputType.py index 4ea3744804..a0798aa653 100644 --- a/trezorlib/messages/TxInputType.py +++ b/trezorlib/messages/TxInputType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType diff --git a/trezorlib/messages/TxOutputBinType.py b/trezorlib/messages/TxOutputBinType.py index 48a646b544..270856e22d 100644 --- a/trezorlib/messages/TxOutputBinType.py +++ b/trezorlib/messages/TxOutputBinType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/TxOutputType.py b/trezorlib/messages/TxOutputType.py index 47a82e3494..63a7f199fb 100644 --- a/trezorlib/messages/TxOutputType.py +++ b/trezorlib/messages/TxOutputType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType diff --git a/trezorlib/messages/TxRequest.py b/trezorlib/messages/TxRequest.py index 0b1028b193..9eb813de76 100644 --- a/trezorlib/messages/TxRequest.py +++ b/trezorlib/messages/TxRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p from .TxRequestDetailsType import TxRequestDetailsType from .TxRequestSerializedType import TxRequestSerializedType diff --git a/trezorlib/messages/TxRequestDetailsType.py b/trezorlib/messages/TxRequestDetailsType.py index 50cd1de78e..ea49a094e3 100644 --- a/trezorlib/messages/TxRequestDetailsType.py +++ b/trezorlib/messages/TxRequestDetailsType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/TxRequestSerializedType.py b/trezorlib/messages/TxRequestSerializedType.py index eda9831682..4225a34def 100644 --- a/trezorlib/messages/TxRequestSerializedType.py +++ b/trezorlib/messages/TxRequestSerializedType.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/TxSize.py b/trezorlib/messages/TxSize.py index 2132a4a801..32713f7e7c 100644 --- a/trezorlib/messages/TxSize.py +++ b/trezorlib/messages/TxSize.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/VerifyMessage.py b/trezorlib/messages/VerifyMessage.py index 5777a279c9..2809357398 100644 --- a/trezorlib/messages/VerifyMessage.py +++ b/trezorlib/messages/VerifyMessage.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/WipeDevice.py b/trezorlib/messages/WipeDevice.py index 3474c983fa..a63bd11394 100644 --- a/trezorlib/messages/WipeDevice.py +++ b/trezorlib/messages/WipeDevice.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/WordAck.py b/trezorlib/messages/WordAck.py index c1914e4373..bbc9a5351d 100644 --- a/trezorlib/messages/WordAck.py +++ b/trezorlib/messages/WordAck.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/WordRequest.py b/trezorlib/messages/WordRequest.py index 06f28a7f70..f03b6b8a2e 100644 --- a/trezorlib/messages/WordRequest.py +++ b/trezorlib/messages/WordRequest.py @@ -1,5 +1,4 @@ # Automatically generated by pb2py -from __future__ import absolute_import from .. import protobuf as p diff --git a/trezorlib/messages/__init__.py b/trezorlib/messages/__init__.py index 32f4488d57..54b9b5174f 100644 --- a/trezorlib/messages/__init__.py +++ b/trezorlib/messages/__init__.py @@ -1,27 +1,26 @@ # Automatically generated by pb2py -from __future__ import absolute_import -from .CoinType import * -from .HDNodePathType import * -from .HDNodeType import * -from .IdentityType import * -from .MultisigRedeemScriptType import * -from .NEMAggregateModification import * -from .NEMCosignatoryModification import * -from .NEMImportanceTransfer import * -from .NEMMosaic import * -from .NEMMosaicCreation import * -from .NEMMosaicDefinition import * -from .NEMMosaicSupplyChange import * -from .NEMProvisionNamespace import * -from .NEMTransactionCommon import * -from .NEMTransfer import * -from .TransactionType import * -from .TxInputType import * -from .TxOutputBinType import * -from .TxOutputType import * -from .TxRequestDetailsType import * -from .TxRequestSerializedType import * +from .CoinType import CoinType +from .HDNodePathType import HDNodePathType +from .HDNodeType import HDNodeType +from .IdentityType import IdentityType +from .MultisigRedeemScriptType import MultisigRedeemScriptType +from .NEMAggregateModification import NEMAggregateModification +from .NEMCosignatoryModification import NEMCosignatoryModification +from .NEMImportanceTransfer import NEMImportanceTransfer +from .NEMMosaic import NEMMosaic +from .NEMMosaicCreation import NEMMosaicCreation +from .NEMMosaicDefinition import NEMMosaicDefinition +from .NEMMosaicSupplyChange import NEMMosaicSupplyChange +from .NEMProvisionNamespace import NEMProvisionNamespace +from .NEMTransactionCommon import NEMTransactionCommon +from .NEMTransfer import NEMTransfer +from .TransactionType import TransactionType +from .TxInputType import TxInputType +from .TxOutputBinType import TxOutputBinType +from .TxOutputType import TxOutputType +from .TxRequestDetailsType import TxRequestDetailsType +from .TxRequestSerializedType import TxRequestSerializedType from . import FailureType from . import OutputScriptType from . import InputScriptType @@ -35,89 +34,89 @@ from . import NEMMosaicLevy from . import NEMSupplyChangeType from . import NEMModificationType from . import NEMImportanceTransferMode -from .Address import * -from .ApplyFlags import * -from .ApplySettings import * -from .BackupDevice import * -from .ButtonAck import * -from .ButtonRequest import * -from .Cancel import * -from .ChangePin import * -from .CipherKeyValue import * -from .CipheredKeyValue import * -from .ClearSession import * -from .CosiCommit import * -from .CosiCommitment import * -from .CosiSign import * -from .CosiSignature import * -from .DebugLinkDecision import * -from .DebugLinkFlashErase import * -from .DebugLinkGetState import * -from .DebugLinkLog import * -from .DebugLinkMemory import * -from .DebugLinkMemoryRead import * -from .DebugLinkMemoryWrite import * -from .DebugLinkState import * -from .DebugLinkStop import * -from .DecryptMessage import * -from .DecryptedMessage import * -from .ECDHSessionKey import * -from .EncryptMessage import * -from .EncryptedMessage import * -from .Entropy import * -from .EntropyAck import * -from .EntropyRequest import * -from .EstimateTxSize import * -from .EthereumAddress import * -from .EthereumGetAddress import * -from .EthereumMessageSignature import * -from .EthereumSignMessage import * -from .EthereumSignTx import * -from .EthereumTxAck import * -from .EthereumTxRequest import * -from .EthereumVerifyMessage import * -from .Failure import * -from .Features import * -from .FirmwareErase import * -from .FirmwareRequest import * -from .FirmwareUpload import * -from .GetAddress import * -from .GetECDHSessionKey import * -from .GetEntropy import * -from .GetFeatures import * -from .GetPublicKey import * -from .Initialize import * -from .LoadDevice import * -from .MessageSignature import * -from .NEMAddress import * -from .NEMDecryptMessage import * -from .NEMDecryptedMessage import * -from .NEMGetAddress import * -from .NEMSignTx import * -from .NEMSignedTx import * -from .PassphraseAck import * -from .PassphraseRequest import * -from .PassphraseStateAck import * -from .PassphraseStateRequest import * -from .PinMatrixAck import * -from .PinMatrixRequest import * -from .Ping import * -from .PublicKey import * -from .RecoveryDevice import * -from .ResetDevice import * -from .SelfTest import * -from .SetU2FCounter import * -from .SignIdentity import * -from .SignMessage import * -from .SignTx import * -from .SignedIdentity import * -from .SimpleSignTx import * -from .Success import * -from .TxAck import * -from .TxRequest import * -from .TxSize import * -from .VerifyMessage import * -from .WipeDevice import * -from .WordAck import * -from .WordRequest import * +from .Address import Address +from .ApplyFlags import ApplyFlags +from .ApplySettings import ApplySettings +from .BackupDevice import BackupDevice +from .ButtonAck import ButtonAck +from .ButtonRequest import ButtonRequest +from .Cancel import Cancel +from .ChangePin import ChangePin +from .CipherKeyValue import CipherKeyValue +from .CipheredKeyValue import CipheredKeyValue +from .ClearSession import ClearSession +from .CosiCommit import CosiCommit +from .CosiCommitment import CosiCommitment +from .CosiSign import CosiSign +from .CosiSignature import CosiSignature +from .DebugLinkDecision import DebugLinkDecision +from .DebugLinkFlashErase import DebugLinkFlashErase +from .DebugLinkGetState import DebugLinkGetState +from .DebugLinkLog import DebugLinkLog +from .DebugLinkMemory import DebugLinkMemory +from .DebugLinkMemoryRead import DebugLinkMemoryRead +from .DebugLinkMemoryWrite import DebugLinkMemoryWrite +from .DebugLinkState import DebugLinkState +from .DebugLinkStop import DebugLinkStop +from .DecryptMessage import DecryptMessage +from .DecryptedMessage import DecryptedMessage +from .ECDHSessionKey import ECDHSessionKey +from .EncryptMessage import EncryptMessage +from .EncryptedMessage import EncryptedMessage +from .Entropy import Entropy +from .EntropyAck import EntropyAck +from .EntropyRequest import EntropyRequest +from .EstimateTxSize import EstimateTxSize +from .EthereumAddress import EthereumAddress +from .EthereumGetAddress import EthereumGetAddress +from .EthereumMessageSignature import EthereumMessageSignature +from .EthereumSignMessage import EthereumSignMessage +from .EthereumSignTx import EthereumSignTx +from .EthereumTxAck import EthereumTxAck +from .EthereumTxRequest import EthereumTxRequest +from .EthereumVerifyMessage import EthereumVerifyMessage +from .Failure import Failure +from .Features import Features +from .FirmwareErase import FirmwareErase +from .FirmwareRequest import FirmwareRequest +from .FirmwareUpload import FirmwareUpload +from .GetAddress import GetAddress +from .GetECDHSessionKey import GetECDHSessionKey +from .GetEntropy import GetEntropy +from .GetFeatures import GetFeatures +from .GetPublicKey import GetPublicKey +from .Initialize import Initialize +from .LoadDevice import LoadDevice +from .MessageSignature import MessageSignature +from .NEMAddress import NEMAddress +from .NEMDecryptMessage import NEMDecryptMessage +from .NEMDecryptedMessage import NEMDecryptedMessage +from .NEMGetAddress import NEMGetAddress +from .NEMSignTx import NEMSignTx +from .NEMSignedTx import NEMSignedTx +from .PassphraseAck import PassphraseAck +from .PassphraseRequest import PassphraseRequest +from .PassphraseStateAck import PassphraseStateAck +from .PassphraseStateRequest import PassphraseStateRequest +from .PinMatrixAck import PinMatrixAck +from .PinMatrixRequest import PinMatrixRequest +from .Ping import Ping +from .PublicKey import PublicKey +from .RecoveryDevice import RecoveryDevice +from .ResetDevice import ResetDevice +from .SelfTest import SelfTest +from .SetU2FCounter import SetU2FCounter +from .SignIdentity import SignIdentity +from .SignMessage import SignMessage +from .SignTx import SignTx +from .SignedIdentity import SignedIdentity +from .SimpleSignTx import SimpleSignTx +from .Success import Success +from .TxAck import TxAck +from .TxRequest import TxRequest +from .TxSize import TxSize +from .VerifyMessage import VerifyMessage +from .WipeDevice import WipeDevice +from .WordAck import WordAck +from .WordRequest import WordRequest from . import MessageType