mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
Signing messages, splitted protobuf
This commit is contained in:
parent
2720665743
commit
3ec7a7685a
10
cmd.py
10
cmd.py
@ -116,6 +116,9 @@ class Commands(object):
|
||||
def sign_message(self, args):
|
||||
return self.client.sign_message(args.n, args.message)
|
||||
|
||||
def verify_message(self, args):
|
||||
return self.client.verify_message(args.address, args.signature, args.message)
|
||||
|
||||
def firmware_update(self, args):
|
||||
if not args.file:
|
||||
raise Exception("Must provide firmware filename")
|
||||
@ -137,6 +140,7 @@ class Commands(object):
|
||||
set_coin.help = 'Switch device to another crypto currency'
|
||||
load_device.help = 'Load custom configuration to the device'
|
||||
sign_message.help = 'Sign message using address of given path'
|
||||
verify_message.help = 'Verify message'
|
||||
firmware_update.help = 'Upload new firmware to device (must be in bootloader mode)'
|
||||
|
||||
get_address.arguments = (
|
||||
@ -171,6 +175,12 @@ class Commands(object):
|
||||
(('message',), {'type': str}),
|
||||
)
|
||||
|
||||
verify_message.arguments = (
|
||||
(('address',), {'type': str}),
|
||||
(('signature',), {'type': str}),
|
||||
(('message',), {'type': str}),
|
||||
)
|
||||
|
||||
get_public_node.arguments = (
|
||||
(('n',), {'metavar': 'N', 'type': int, 'nargs': '+'}),
|
||||
)
|
||||
|
6
protob/build.sh
Executable file
6
protob/build.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd `dirname $0`/../../trezor-common/protob
|
||||
|
||||
protoc --python_out=../../trezor-emu/trezor/ -I/usr/include -I. types.proto
|
||||
protoc --python_out=../../trezor-emu/trezor/ -I/usr/include -I. messages.proto
|
@ -1,6 +1,7 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
import ckd_public
|
||||
import trezor_pb2 as proto
|
||||
|
||||
def show_message(message):
|
||||
@ -39,7 +40,6 @@ class TrezorClient(object):
|
||||
return os.urandom(32)
|
||||
|
||||
def init_device(self):
|
||||
self.master_public_key = None
|
||||
self.features = self.call(proto.Initialize())
|
||||
|
||||
def close(self):
|
||||
@ -47,12 +47,9 @@ class TrezorClient(object):
|
||||
if self.debuglink:
|
||||
self.debuglink.transport.close()
|
||||
|
||||
def get_master_public_key(self):
|
||||
if self.master_public_key:
|
||||
return self.master_public_key
|
||||
|
||||
self.master_public_key = self.call(proto.GetMasterPublicKey()).mpk
|
||||
return self.master_public_key
|
||||
def get_public_node(self, n):
|
||||
# print self.bip32_ckd(self.call(proto.GetPublicKey(address_n=n)).node, [2, ])
|
||||
return self.call(proto.GetPublicKey(address_n=n)).node
|
||||
|
||||
def get_address(self, n):
|
||||
return self.call(proto.GetAddress(address_n=n)).address
|
||||
@ -139,7 +136,20 @@ class TrezorClient(object):
|
||||
print "Received", self._pprint(resp)
|
||||
|
||||
return resp
|
||||
|
||||
|
||||
def sign_message(self, n, message):
|
||||
return self.call(proto.SignMessage(address_n=n, message=message))
|
||||
|
||||
def verify_message(self, address, signature, message):
|
||||
try:
|
||||
resp = self.call(proto.VerifyMessage(address=address, signature=signature, message=message))
|
||||
if isinstance(resp, proto.Success):
|
||||
return True
|
||||
except CallException:
|
||||
pass
|
||||
|
||||
return False
|
||||
|
||||
def sign_tx(self, inputs, outputs):
|
||||
'''
|
||||
inputs: list of TxInput
|
||||
@ -260,6 +270,18 @@ class TrezorClient(object):
|
||||
self.init_device()
|
||||
return isinstance(resp, proto.Success)
|
||||
|
||||
def bip32_ckd(self, public_node, n):
|
||||
if not isinstance(n, list):
|
||||
raise Exception('Parameter must be a list')
|
||||
|
||||
node = proto.HDNodeType()
|
||||
node.CopyFrom(public_node)
|
||||
|
||||
for i in n:
|
||||
node.CopyFrom(ckd_public.get_subnode(node, i))
|
||||
|
||||
return node
|
||||
|
||||
def firmware_update(self, fp):
|
||||
if self.features.bootloader_mode == False:
|
||||
raise Exception("Device must be in bootloader mode")
|
||||
|
File diff suppressed because one or more lines are too long
557
trezorlib/types_pb2.py
Normal file
557
trezorlib/types_pb2.py
Normal file
@ -0,0 +1,557 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: types.proto
|
||||
|
||||
from google.protobuf.internal import enum_type_wrapper
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import descriptor_pb2
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
|
||||
import google.protobuf.descriptor_pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='types.proto',
|
||||
package='',
|
||||
serialized_pb='\n\x0btypes.proto\x1a google/protobuf/descriptor.proto\"\xb4\x01\n\nHDNodeType\x12\x0f\n\x07version\x18\x01 \x02(\r\x12\r\n\x05\x64\x65pth\x18\x02 \x02(\r\x12\x13\n\x0b\x66ingerprint\x18\x03 \x02(\r\x12\x11\n\tchild_num\x18\x04 \x02(\r\x12\x18\n\nchain_code\x18\x05 \x02(\x0c\x42\x04\x88\xb5\x18\x01\x12\x19\n\x0bprivate_key\x18\x06 \x01(\x0c\x42\x04\x88\xb5\x18\x01\x12\x18\n\npublic_key\x18\x07 \x01(\x0c\x42\x04\x88\xb5\x18\x01\x12\x0f\n\x07\x61\x64\x64ress\x18\x08 \x01(\x0c\"]\n\x08\x43oinType\x12\x11\n\tcoin_name\x18\x01 \x01(\x0c\x12\x15\n\rcoin_shortcut\x18\x02 \x01(\x0c\x12\x14\n\x0c\x61\x64\x64ress_type\x18\x03 \x01(\r\x12\x11\n\tmaxfee_kb\x18\x04 \x01(\x04\"\x85\x01\n\x0bTxInputType\x12\x11\n\taddress_n\x18\x01 \x03(\r\x12\x17\n\tprev_hash\x18\x02 \x02(\x0c\x42\x04\x88\xb5\x18\x01\x12\x12\n\nprev_index\x18\x03 \x02(\r\x12\x18\n\nscript_sig\x18\x04 \x01(\x0c\x42\x04\x88\xb5\x18\x01\x12\x1c\n\x08sequence\x18\x05 \x01(\r:\n4294967295\"\x7f\n\x0cTxOutputType\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x02(\x0c\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\x19\n\x0bscript_args\x18\x05 \x03(\x0c\x42\x04\x88\xb5\x18\x01\">\n\x0fTxOutputBinType\x12\x0e\n\x06\x61mount\x18\x01 \x02(\x04\x12\x1b\n\rscript_pubkey\x18\x02 \x02(\x0c\x42\x04\x88\xb5\x18\x01\"|\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*\x82\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\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:/\n\x06\x62inary\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\x08: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')
|
||||
|
||||
_FAILURETYPE = _descriptor.EnumDescriptor(
|
||||
name='FailureType',
|
||||
full_name='FailureType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_UnexpectedMessage', index=0, number=1,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_ButtonExpected', index=1, number=2,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_SyntaxError', index=2, number=3,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_ActionCancelled', index=3, number=4,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_PinExpected', index=4, number=5,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_PinCancelled', index=5, number=6,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_PinInvalid', index=6, number=7,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_InvalidSignature', index=7, number=8,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='Failure_FirmwareError', index=8, number=99,
|
||||
options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
options=None,
|
||||
serialized_start=783,
|
||||
serialized_end=1041,
|
||||
)
|
||||
|
||||
FailureType = enum_type_wrapper.EnumTypeWrapper(_FAILURETYPE)
|
||||
_SCRIPTTYPE = _descriptor.EnumDescriptor(
|
||||
name='ScriptType',
|
||||
full_name='ScriptType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='PAYTOADDRESS', index=0, number=0,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='PAYTOSCRIPTHASH', index=1, number=1,
|
||||
options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
options=None,
|
||||
serialized_start=1043,
|
||||
serialized_end=1094,
|
||||
)
|
||||
|
||||
ScriptType = enum_type_wrapper.EnumTypeWrapper(_SCRIPTTYPE)
|
||||
_REQUESTTYPE = _descriptor.EnumDescriptor(
|
||||
name='RequestType',
|
||||
full_name='RequestType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='TXINPUT', index=0, number=0,
|
||||
options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='TXOUTPUT', index=1, number=1,
|
||||
options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
options=None,
|
||||
serialized_start=1096,
|
||||
serialized_end=1136,
|
||||
)
|
||||
|
||||
RequestType = enum_type_wrapper.EnumTypeWrapper(_REQUESTTYPE)
|
||||
Failure_UnexpectedMessage = 1
|
||||
Failure_ButtonExpected = 2
|
||||
Failure_SyntaxError = 3
|
||||
Failure_ActionCancelled = 4
|
||||
Failure_PinExpected = 5
|
||||
Failure_PinCancelled = 6
|
||||
Failure_PinInvalid = 7
|
||||
Failure_InvalidSignature = 8
|
||||
Failure_FirmwareError = 99
|
||||
PAYTOADDRESS = 0
|
||||
PAYTOSCRIPTHASH = 1
|
||||
TXINPUT = 0
|
||||
TXOUTPUT = 1
|
||||
|
||||
BINARY_FIELD_NUMBER = 50001
|
||||
binary = _descriptor.FieldDescriptor(
|
||||
name='binary', full_name='binary', index=0,
|
||||
number=50001, 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=True, extension_scope=None,
|
||||
options=None)
|
||||
WIRE_IN_FIELD_NUMBER = 50002
|
||||
wire_in = _descriptor.FieldDescriptor(
|
||||
name='wire_in', full_name='wire_in', index=1,
|
||||
number=50002, 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=True, extension_scope=None,
|
||||
options=None)
|
||||
WIRE_OUT_FIELD_NUMBER = 50003
|
||||
wire_out = _descriptor.FieldDescriptor(
|
||||
name='wire_out', full_name='wire_out', index=2,
|
||||
number=50003, 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=True, extension_scope=None,
|
||||
options=None)
|
||||
WIRE_DEBUG_IN_FIELD_NUMBER = 50004
|
||||
wire_debug_in = _descriptor.FieldDescriptor(
|
||||
name='wire_debug_in', full_name='wire_debug_in', index=3,
|
||||
number=50004, 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=True, extension_scope=None,
|
||||
options=None)
|
||||
WIRE_DEBUG_OUT_FIELD_NUMBER = 50005
|
||||
wire_debug_out = _descriptor.FieldDescriptor(
|
||||
name='wire_debug_out', full_name='wire_debug_out', index=4,
|
||||
number=50005, 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=True, extension_scope=None,
|
||||
options=None)
|
||||
|
||||
|
||||
_HDNODETYPE = _descriptor.Descriptor(
|
||||
name='HDNodeType',
|
||||
full_name='HDNodeType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='version', full_name='HDNodeType.version', index=0,
|
||||
number=1, type=13, cpp_type=3, label=2,
|
||||
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='depth', full_name='HDNodeType.depth', index=1,
|
||||
number=2, type=13, cpp_type=3, label=2,
|
||||
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='fingerprint', full_name='HDNodeType.fingerprint', index=2,
|
||||
number=3, type=13, cpp_type=3, label=2,
|
||||
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='child_num', full_name='HDNodeType.child_num', index=3,
|
||||
number=4, type=13, cpp_type=3, label=2,
|
||||
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='chain_code', full_name='HDNodeType.chain_code', index=4,
|
||||
number=5, type=12, cpp_type=9, label=2,
|
||||
has_default_value=False, default_value="",
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='private_key', full_name='HDNodeType.private_key', 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=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='public_key', full_name='HDNodeType.public_key', index=6,
|
||||
number=7, 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=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='address', full_name='HDNodeType.address', index=7,
|
||||
number=8, 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),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
options=None,
|
||||
is_extendable=False,
|
||||
extension_ranges=[],
|
||||
serialized_start=50,
|
||||
serialized_end=230,
|
||||
)
|
||||
|
||||
|
||||
_COINTYPE = _descriptor.Descriptor(
|
||||
name='CoinType',
|
||||
full_name='CoinType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='coin_name', full_name='CoinType.coin_name', index=0,
|
||||
number=1, 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='coin_shortcut', full_name='CoinType.coin_shortcut', index=1,
|
||||
number=2, 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='address_type', full_name='CoinType.address_type', 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='maxfee_kb', full_name='CoinType.maxfee_kb', index=3,
|
||||
number=4, type=4, cpp_type=4, 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=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
options=None,
|
||||
is_extendable=False,
|
||||
extension_ranges=[],
|
||||
serialized_start=232,
|
||||
serialized_end=325,
|
||||
)
|
||||
|
||||
|
||||
_TXINPUTTYPE = _descriptor.Descriptor(
|
||||
name='TxInputType',
|
||||
full_name='TxInputType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='address_n', full_name='TxInputType.address_n', index=0,
|
||||
number=1, type=13, cpp_type=3, 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='prev_hash', full_name='TxInputType.prev_hash', index=1,
|
||||
number=2, type=12, cpp_type=9, label=2,
|
||||
has_default_value=False, default_value="",
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='prev_index', full_name='TxInputType.prev_index', index=2,
|
||||
number=3, type=13, cpp_type=3, label=2,
|
||||
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='script_sig', full_name='TxInputType.script_sig', index=3,
|
||||
number=4, 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=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='sequence', full_name='TxInputType.sequence', index=4,
|
||||
number=5, type=13, cpp_type=3, label=1,
|
||||
has_default_value=True, default_value=4294967295,
|
||||
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=328,
|
||||
serialized_end=461,
|
||||
)
|
||||
|
||||
|
||||
_TXOUTPUTTYPE = _descriptor.Descriptor(
|
||||
name='TxOutputType',
|
||||
full_name='TxOutputType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='address', full_name='TxOutputType.address', index=0,
|
||||
number=1, type=12, cpp_type=9, label=2,
|
||||
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='address_n', full_name='TxOutputType.address_n', index=1,
|
||||
number=2, type=13, cpp_type=3, 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='amount', full_name='TxOutputType.amount', index=2,
|
||||
number=3, type=4, cpp_type=4, label=2,
|
||||
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='script_type', full_name='TxOutputType.script_type', index=3,
|
||||
number=4, type=14, cpp_type=8, label=2,
|
||||
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='script_args', full_name='TxOutputType.script_args', index=4,
|
||||
number=5, type=12, cpp_type=9, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
options=None,
|
||||
is_extendable=False,
|
||||
extension_ranges=[],
|
||||
serialized_start=463,
|
||||
serialized_end=590,
|
||||
)
|
||||
|
||||
|
||||
_TXOUTPUTBINTYPE = _descriptor.Descriptor(
|
||||
name='TxOutputBinType',
|
||||
full_name='TxOutputBinType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='amount', full_name='TxOutputBinType.amount', index=0,
|
||||
number=1, type=4, cpp_type=4, label=2,
|
||||
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='script_pubkey', full_name='TxOutputBinType.script_pubkey', index=1,
|
||||
number=2, type=12, cpp_type=9, label=2,
|
||||
has_default_value=False, default_value="",
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
options=None,
|
||||
is_extendable=False,
|
||||
extension_ranges=[],
|
||||
serialized_start=592,
|
||||
serialized_end=654,
|
||||
)
|
||||
|
||||
|
||||
_TRANSACTIONTYPE = _descriptor.Descriptor(
|
||||
name='TransactionType',
|
||||
full_name='TransactionType',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_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,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
options=None),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='inputs', full_name='TransactionType.inputs', index=1,
|
||||
number=2, 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='outputs', full_name='TransactionType.outputs', index=2,
|
||||
number=3, 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=3,
|
||||
number=4, type=13, cpp_type=3, label=1,
|
||||
has_default_value=True, default_value=0,
|
||||
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=656,
|
||||
serialized_end=780,
|
||||
)
|
||||
|
||||
_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
|
||||
DESCRIPTOR.message_types_by_name['HDNodeType'] = _HDNODETYPE
|
||||
DESCRIPTOR.message_types_by_name['CoinType'] = _COINTYPE
|
||||
DESCRIPTOR.message_types_by_name['TxInputType'] = _TXINPUTTYPE
|
||||
DESCRIPTOR.message_types_by_name['TxOutputType'] = _TXOUTPUTTYPE
|
||||
DESCRIPTOR.message_types_by_name['TxOutputBinType'] = _TXOUTPUTBINTYPE
|
||||
DESCRIPTOR.message_types_by_name['TransactionType'] = _TRANSACTIONTYPE
|
||||
|
||||
class HDNodeType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _HDNODETYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:HDNodeType)
|
||||
|
||||
class CoinType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _COINTYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:CoinType)
|
||||
|
||||
class TxInputType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _TXINPUTTYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:TxInputType)
|
||||
|
||||
class TxOutputType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _TXOUTPUTTYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:TxOutputType)
|
||||
|
||||
class TxOutputBinType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _TXOUTPUTBINTYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:TxOutputBinType)
|
||||
|
||||
class TransactionType(_message.Message):
|
||||
__metaclass__ = _reflection.GeneratedProtocolMessageType
|
||||
DESCRIPTOR = _TRANSACTIONTYPE
|
||||
|
||||
# @@protoc_insertion_point(class_scope:TransactionType)
|
||||
|
||||
google.protobuf.descriptor_pb2.FieldOptions.RegisterExtension(binary)
|
||||
google.protobuf.descriptor_pb2.EnumValueOptions.RegisterExtension(wire_in)
|
||||
google.protobuf.descriptor_pb2.EnumValueOptions.RegisterExtension(wire_out)
|
||||
google.protobuf.descriptor_pb2.EnumValueOptions.RegisterExtension(wire_debug_in)
|
||||
google.protobuf.descriptor_pb2.EnumValueOptions.RegisterExtension(wire_debug_out)
|
||||
|
||||
_HDNODETYPE.fields_by_name['chain_code'].has_options = True
|
||||
_HDNODETYPE.fields_by_name['chain_code']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_HDNODETYPE.fields_by_name['private_key'].has_options = True
|
||||
_HDNODETYPE.fields_by_name['private_key']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_HDNODETYPE.fields_by_name['public_key'].has_options = True
|
||||
_HDNODETYPE.fields_by_name['public_key']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_TXINPUTTYPE.fields_by_name['prev_hash'].has_options = True
|
||||
_TXINPUTTYPE.fields_by_name['prev_hash']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_TXINPUTTYPE.fields_by_name['script_sig'].has_options = True
|
||||
_TXINPUTTYPE.fields_by_name['script_sig']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_TXOUTPUTTYPE.fields_by_name['script_args'].has_options = True
|
||||
_TXOUTPUTTYPE.fields_by_name['script_args']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
_TXOUTPUTBINTYPE.fields_by_name['script_pubkey'].has_options = True
|
||||
_TXOUTPUTBINTYPE.fields_by_name['script_pubkey']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\210\265\030\001')
|
||||
# @@protoc_insertion_point(module_scope)
|
Loading…
Reference in New Issue
Block a user