1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

Fixed protobuf, int32 instead of uint32 in InputRequest

This commit is contained in:
slush 2013-01-14 19:20:55 +01:00
parent 1e6588e28f
commit db26da19a9
2 changed files with 14 additions and 14 deletions

View File

@ -11,7 +11,7 @@ from google.protobuf import descriptor_pb2
DESCRIPTOR = descriptor.FileDescriptor( DESCRIPTOR = descriptor.FileDescriptor(
name='bitkey.proto', name='bitkey.proto',
package='', package='',
serialized_pb='\n\x0c\x62itkey.proto\" \n\nInitialize\x12\x12\n\nsession_id\x18\x01 \x02(\x0c\"\xc4\x01\n\x08\x46\x65\x61tures\x12\x12\n\nsession_id\x18\x01 \x02(\x0c\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\x15\n\rmajor_version\x18\x03 \x01(\r\x12\x15\n\rminor_version\x18\x04 \x01(\r\x12\x0b\n\x03otp\x18\x05 \x01(\x08\x12\x0b\n\x03pin\x18\x06 \x01(\x08\x12\x0b\n\x03spv\x18\x07 \x01(\x08\x12\x11\n\tmaxfee_kb\x18\x08 \x01(\x04\x12\x18\n\x04\x61lgo\x18\t \x03(\x0e\x32\n.Algorithm\x12\x12\n\ndebug_link\x18\n \x01(\x08\"\x17\n\x04Ping\x12\x0f\n\x07message\x18\x01 \x01(\t\"#\n\x11\x44\x65\x62ugLinkDecision\x12\x0e\n\x06yes_no\x18\x01 \x02(\x08\"K\n\x11\x44\x65\x62ugLinkGetState\x12\x0e\n\x06layout\x18\x01 \x01(\x08\x12\x0b\n\x03otp\x18\x02 \x01(\x08\x12\x0b\n\x03pin\x18\x03 \x01(\x08\x12\x0c\n\x04seed\x18\x04 \x01(\x08\"Z\n\x0e\x44\x65\x62ugLinkState\x12\x0e\n\x06layout\x18\x01 \x01(\x0c\x12\x14\n\x03otp\x18\x02 \x01(\x0b\x32\x07.OtpAck\x12\x14\n\x03pin\x18\x03 \x01(\x0b\x32\x07.PinAck\x12\x0c\n\x04seed\x18\x04 \x01(\t\"\x1a\n\x07Success\x12\x0f\n\x07message\x18\x01 \x01(\t\"(\n\x07\x46\x61ilure\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\"\t\n\x07GetUUID\"\x14\n\x04UUID\x12\x0c\n\x04UUID\x18\x01 \x02(\x0c\"\x0f\n\rButtonRequest\"\x0b\n\tButtonAck\"\x0e\n\x0c\x42uttonCancel\"\x1d\n\nOtpRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x15\n\x06OtpAck\x12\x0b\n\x03otp\x18\x01 \x02(\t\"\x0b\n\tOtpCancel\"\x1d\n\nPinRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x15\n\x06PinAck\x12\x0b\n\x03pin\x18\x01 \x02(\t\"\x0b\n\tPinCancel\"\x1a\n\nGetEntropy\x12\x0c\n\x04size\x18\x01 \x02(\r\"\x1a\n\x07\x45ntropy\x12\x0f\n\x07\x65ntropy\x18\x01 \x02(\x0c\" \n\x0bSetMaxFeeKb\x12\x11\n\tmaxfee_kb\x18\x01 \x02(\x04\"5\n\x12GetMasterPublicKey\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\"\x1e\n\x0fMasterPublicKey\x12\x0b\n\x03key\x18\x01 \x02(\x0c\"@\n\nGetAddress\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\x12\x11\n\taddress_n\x18\x02 \x03(\r\"\x1a\n\x07\x41\x64\x64ress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x02(\t\"M\n\nLoadDevice\x12\x0c\n\x04seed\x18\x01 \x02(\t\x12\x11\n\x03otp\x18\x02 \x01(\x08:\x04true\x12\x0b\n\x03pin\x18\x03 \x01(\t\x12\x11\n\x03spv\x18\x04 \x01(\x08:\x04true\"\x1d\n\x0bResetDevice\x12\x0e\n\x06random\x18\x07 \x01(\x0c\"f\n\x06SignTx\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\x12\x15\n\routputs_count\x18\x03 \x03(\r\x12\x14\n\x0cinputs_count\x18\x05 \x03(\r\x12\x0e\n\x06random\x18\x06 \x01(\x0c\"N\n\x0cInputRequest\x12\x15\n\rrequest_index\x18\x01 \x01(\r\x12\x14\n\x0csigned_index\x18\x02 \x01(\r\x12\x11\n\tsignature\x18\x03 \x01(\x0c\"&\n\rOutputRequest\x12\x15\n\rrequest_index\x18\x01 \x02(\r\"v\n\x07TxInput\x12\r\n\x05index\x18\x01 \x02(\r\x12\x11\n\taddress_n\x18\x02 \x03(\r\x12\x0e\n\x06\x61mount\x18\x03 \x02(\x04\x12\x11\n\tprev_hash\x18\x04 \x02(\x0c\x12\x12\n\nprev_index\x18\x05 \x02(\r\x12\x12\n\nscript_sig\x18\x06 \x01(\x0c\"\x84\x01\n\x08TxOutput\x12\r\n\x05index\x18\x01 \x02(\r\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x02(\t\x12\x11\n\taddress_n\x18\x03 \x03(\r\x12\x0e\n\x06\x61mount\x18\x04 \x02(\x04\x12 \n\x0bscript_type\x18\x05 \x02(\x0e\x32\x0b.ScriptType\x12\x13\n\x0bscript_args\x18\x06 \x03(\x0c*$\n\tAlgorithm\x12\t\n\x05\x42IP32\x10\x00\x12\x0c\n\x08\x45LECTRUM\x10\x01*3\n\nScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01') serialized_pb='\n\x0c\x62itkey.proto\" \n\nInitialize\x12\x12\n\nsession_id\x18\x01 \x02(\x0c\"\xc4\x01\n\x08\x46\x65\x61tures\x12\x12\n\nsession_id\x18\x01 \x02(\x0c\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\x15\n\rmajor_version\x18\x03 \x01(\r\x12\x15\n\rminor_version\x18\x04 \x01(\r\x12\x0b\n\x03otp\x18\x05 \x01(\x08\x12\x0b\n\x03pin\x18\x06 \x01(\x08\x12\x0b\n\x03spv\x18\x07 \x01(\x08\x12\x11\n\tmaxfee_kb\x18\x08 \x01(\x04\x12\x18\n\x04\x61lgo\x18\t \x03(\x0e\x32\n.Algorithm\x12\x12\n\ndebug_link\x18\n \x01(\x08\"\x17\n\x04Ping\x12\x0f\n\x07message\x18\x01 \x01(\t\"#\n\x11\x44\x65\x62ugLinkDecision\x12\x0e\n\x06yes_no\x18\x01 \x02(\x08\"K\n\x11\x44\x65\x62ugLinkGetState\x12\x0e\n\x06layout\x18\x01 \x01(\x08\x12\x0b\n\x03otp\x18\x02 \x01(\x08\x12\x0b\n\x03pin\x18\x03 \x01(\x08\x12\x0c\n\x04seed\x18\x04 \x01(\x08\"Z\n\x0e\x44\x65\x62ugLinkState\x12\x0e\n\x06layout\x18\x01 \x01(\x0c\x12\x14\n\x03otp\x18\x02 \x01(\x0b\x32\x07.OtpAck\x12\x14\n\x03pin\x18\x03 \x01(\x0b\x32\x07.PinAck\x12\x0c\n\x04seed\x18\x04 \x01(\t\"\x1a\n\x07Success\x12\x0f\n\x07message\x18\x01 \x01(\t\"(\n\x07\x46\x61ilure\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\"\t\n\x07GetUUID\"\x14\n\x04UUID\x12\x0c\n\x04UUID\x18\x01 \x02(\x0c\"\x0f\n\rButtonRequest\"\x0b\n\tButtonAck\"\x0e\n\x0c\x42uttonCancel\"\x1d\n\nOtpRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x15\n\x06OtpAck\x12\x0b\n\x03otp\x18\x01 \x02(\t\"\x0b\n\tOtpCancel\"\x1d\n\nPinRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x15\n\x06PinAck\x12\x0b\n\x03pin\x18\x01 \x02(\t\"\x0b\n\tPinCancel\"\x1a\n\nGetEntropy\x12\x0c\n\x04size\x18\x01 \x02(\r\"\x1a\n\x07\x45ntropy\x12\x0f\n\x07\x65ntropy\x18\x01 \x02(\x0c\" \n\x0bSetMaxFeeKb\x12\x11\n\tmaxfee_kb\x18\x01 \x02(\x04\"5\n\x12GetMasterPublicKey\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\"\x1e\n\x0fMasterPublicKey\x12\x0b\n\x03key\x18\x01 \x02(\x0c\"@\n\nGetAddress\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\x12\x11\n\taddress_n\x18\x02 \x03(\r\"\x1a\n\x07\x41\x64\x64ress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x02(\t\"M\n\nLoadDevice\x12\x0c\n\x04seed\x18\x01 \x02(\t\x12\x11\n\x03otp\x18\x02 \x01(\x08:\x04true\x12\x0b\n\x03pin\x18\x03 \x01(\t\x12\x11\n\x03spv\x18\x04 \x01(\x08:\x04true\"\x1d\n\x0bResetDevice\x12\x0e\n\x06random\x18\x07 \x01(\x0c\"f\n\x06SignTx\x12\x1f\n\x04\x61lgo\x18\x01 \x02(\x0e\x32\n.Algorithm:\x05\x42IP32\x12\x15\n\routputs_count\x18\x03 \x02(\r\x12\x14\n\x0cinputs_count\x18\x05 \x02(\r\x12\x0e\n\x06random\x18\x06 \x01(\x0c\"N\n\x0cInputRequest\x12\x15\n\rrequest_index\x18\x01 \x01(\x05\x12\x14\n\x0csigned_index\x18\x02 \x01(\x05\x12\x11\n\tsignature\x18\x03 \x01(\x0c\"&\n\rOutputRequest\x12\x15\n\rrequest_index\x18\x01 \x02(\r\"v\n\x07TxInput\x12\r\n\x05index\x18\x01 \x02(\r\x12\x11\n\taddress_n\x18\x02 \x03(\r\x12\x0e\n\x06\x61mount\x18\x03 \x02(\x04\x12\x11\n\tprev_hash\x18\x04 \x02(\x0c\x12\x12\n\nprev_index\x18\x05 \x02(\r\x12\x12\n\nscript_sig\x18\x06 \x01(\x0c\"\x84\x01\n\x08TxOutput\x12\r\n\x05index\x18\x01 \x02(\r\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x02(\t\x12\x11\n\taddress_n\x18\x03 \x03(\r\x12\x0e\n\x06\x61mount\x18\x04 \x02(\x04\x12 \n\x0bscript_type\x18\x05 \x02(\x0e\x32\x0b.ScriptType\x12\x13\n\x0bscript_args\x18\x06 \x03(\x0c*$\n\tAlgorithm\x12\t\n\x05\x42IP32\x10\x00\x12\x0c\n\x08\x45LECTRUM\x10\x01*3\n\nScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\x00\x12\x13\n\x0fPAYTOSCRIPTHASH\x10\x01')
_ALGORITHM = descriptor.EnumDescriptor( _ALGORITHM = descriptor.EnumDescriptor(
name='Algorithm', name='Algorithm',
@ -962,15 +962,15 @@ _SIGNTX = descriptor.Descriptor(
options=None), options=None),
descriptor.FieldDescriptor( descriptor.FieldDescriptor(
name='outputs_count', full_name='SignTx.outputs_count', index=1, name='outputs_count', full_name='SignTx.outputs_count', index=1,
number=3, type=13, cpp_type=3, label=3, number=3, type=13, cpp_type=3, label=2,
has_default_value=False, default_value=[], has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None, message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None, is_extension=False, extension_scope=None,
options=None), options=None),
descriptor.FieldDescriptor( descriptor.FieldDescriptor(
name='inputs_count', full_name='SignTx.inputs_count', index=2, name='inputs_count', full_name='SignTx.inputs_count', index=2,
number=5, type=13, cpp_type=3, label=3, number=5, type=13, cpp_type=3, label=2,
has_default_value=False, default_value=[], has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None, message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None, is_extension=False, extension_scope=None,
options=None), options=None),
@ -1004,14 +1004,14 @@ _INPUTREQUEST = descriptor.Descriptor(
fields=[ fields=[
descriptor.FieldDescriptor( descriptor.FieldDescriptor(
name='request_index', full_name='InputRequest.request_index', index=0, name='request_index', full_name='InputRequest.request_index', index=0,
number=1, type=13, cpp_type=3, label=1, number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0, has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None, message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None, is_extension=False, extension_scope=None,
options=None), options=None),
descriptor.FieldDescriptor( descriptor.FieldDescriptor(
name='signed_index', full_name='InputRequest.signed_index', index=1, name='signed_index', full_name='InputRequest.signed_index', index=1,
number=2, type=13, cpp_type=3, label=1, number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0, has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None, message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None, is_extension=False, extension_scope=None,

View File

@ -215,8 +215,8 @@ message ResetDevice {
// Response: InputRequest, OutputRequest, OtpRequest, PinRequest, Failure // Response: InputRequest, OutputRequest, OtpRequest, PinRequest, Failure
message SignTx { message SignTx {
required Algorithm algo = 1 [default=BIP32]; // Algorithm using for key generation algorithm required Algorithm algo = 1 [default=BIP32]; // Algorithm using for key generation algorithm
repeated uint32 outputs_count = 3; // Count of outputs of the transaction required uint32 outputs_count = 3; // Count of outputs of the transaction
repeated uint32 inputs_count = 5; // Count of inputs of the transaction required uint32 inputs_count = 5; // Count of inputs of the transaction
optional bytes random = 6; // Provide additional entropy for signing function. optional bytes random = 6; // Provide additional entropy for signing function.
// Recommended to provide 256 bytes of random data. // Recommended to provide 256 bytes of random data.
} }
@ -225,9 +225,9 @@ message SignTx {
// If request_index is set, device asks for TxInput message with details of index's input. // If request_index is set, device asks for TxInput message with details of index's input.
// If signed_index is set, 'signature' contains signed input of signed_index's input. // If signed_index is set, 'signature' contains signed input of signed_index's input.
message InputRequest { message InputRequest {
optional uint32 request_index = 1; // If presented, device expects TxInput message from the computer optional int32 request_index = 1; // If >=0, device expects TxInput message from the computer
optional uint32 signed_index = 2; // If presented, 'signature' contains signed input of this input optional int32 signed_index = 2; // If >=0, 'signature' contains signed input of this input
optional bytes signature = 3; // If presented, represent signature of the signed_index input optional bytes signature = 3; // If signed_index>=0, represent signature of the signed_index input
} }
// Sent by the device as a response for SignTx or TxInput. // Sent by the device as a response for SignTx or TxInput.
@ -243,8 +243,8 @@ message TxInput {
required uint32 index = 1; // Position of input in proposed transaction required uint32 index = 1; // Position of input in proposed transaction
repeated uint32 address_n = 2; // Parameter for address generation algorithm to derive the address from the master public key repeated uint32 address_n = 2; // Parameter for address generation algorithm to derive the address from the master public key
required uint64 amount = 3; // Amount to spend in satoshis. The rest will be used for transaction fees required uint64 amount = 3; // Amount to spend in satoshis. The rest will be used for transaction fees
required bytes prev_hash = 4; // Hash of previous transaction spent by this input required bytes prev_hash = 4; // Hash of previous transaction output to spend by this input
required uint32 prev_index = 5; // Index of previous spent output required uint32 prev_index = 5; // Index of previous output to spend
optional bytes script_sig = 6; // Script signature optional bytes script_sig = 6; // Script signature
} }