1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

common: add "unstable" as a custom protobuf extension (fixes #1220)

This commit is contained in:
matejcik 2020-08-24 15:55:27 +02:00 committed by matejcik
parent 5429acdb7f
commit 336000154a
2 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@ package hw.trezor.messages.bitcoin;
option java_package = "com.satoshilabs.trezor.lib.protobuf"; option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageBitcoin"; option java_outer_classname = "TrezorMessageBitcoin";
import "messages.proto";
import "messages-common.proto"; import "messages-common.proto";
/** /**
@ -26,13 +27,13 @@ message MultisigRedeemScriptType {
repeated HDNodePathType pubkeys = 1; // pubkeys from multisig address (sorted lexicographically) repeated HDNodePathType pubkeys = 1; // pubkeys from multisig address (sorted lexicographically)
repeated bytes signatures = 2; // existing signatures for partially signed input repeated bytes signatures = 2; // existing signatures for partially signed input
optional uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending optional uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending
repeated hw.trezor.messages.common.HDNodeType nodes = 4; // simplified way how to specify pubkeys if they share the same address_n path repeated common.HDNodeType nodes = 4; // simplified way how to specify pubkeys if they share the same address_n path
repeated uint32 address_n = 5; // use only field 1 or fields 4+5, if fields 4+5 are used, field 1 is ignored repeated uint32 address_n = 5; // use only field 1 or fields 4+5, if fields 4+5 are used, field 1 is ignored
/** /**
* Structure representing HDNode + Path * Structure representing HDNode + Path
*/ */
message HDNodePathType { message HDNodePathType {
required hw.trezor.messages.common.HDNodeType node = 1; // BIP-32 node in deserialized form required common.HDNodeType node = 1; // BIP-32 node in deserialized form
repeated uint32 address_n = 2; // BIP-32 path to derive the key from node repeated uint32 address_n = 2; // BIP-32 path to derive the key from node
} }
} }
@ -56,7 +57,7 @@ message GetPublicKey {
* @end * @end
*/ */
message PublicKey { message PublicKey {
optional hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node optional common.HDNodeType node = 1; // BIP32 public node
optional string xpub = 2; // serialized form of public node optional string xpub = 2; // serialized form of public node
} }
@ -306,6 +307,8 @@ message OwnershipProof {
* @next Failure * @next Failure
*/ */
message AuthorizeCoinJoin { message AuthorizeCoinJoin {
option (unstable) = true;
required string coordinator = 1; // coordinator identifier to approve as a prefix in commitment data (max. 18 ASCII characters) required string coordinator = 1; // coordinator identifier to approve as a prefix in commitment data (max. 18 ASCII characters)
required uint64 max_total_fee = 2; // maximum total fees required uint64 max_total_fee = 2; // maximum total fees
optional uint32 fee_per_anonymity = 3; // fee per anonymity set in units of 10^-9 percent optional uint32 fee_per_anonymity = 3; // fee per anonymity set in units of 10^-9 percent

View File

@ -24,6 +24,13 @@ extend google.protobuf.EnumValueOptions {
optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode
} }
/** Options for tagging message types */
extend google.protobuf.MessageOptions {
optional bool unstable = 50001; // indicate that a message definition might change at any time
}
/** /**
* Mapping between Trezor wire identifier (uint) and a protobuf message * Mapping between Trezor wire identifier (uint) and a protobuf message
*/ */