chore(common): Rename "unstable" protobuf tag to "experimental_message".

[no changelog]
pull/2600/head
Andrew Kozlik 2 years ago committed by Andrew Kozlik
parent 4e79eec188
commit 3d645d609a

@ -343,7 +343,7 @@ message TxAck {
// optional uint32 block_height_bip115 = 9; // BIP-115 support dropped
optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was present (used when creating a replacement transaction)
optional uint32 orig_index = 11; // index of the output in the original transaction (used when creating a replacement transaction)
optional uint32 payment_req_index = 12 [(experimental)=true]; // index of the PaymentRequest containing this output
optional uint32 payment_req_index = 12 [(experimental_field)=true]; // index of the PaymentRequest containing this output
}
}
}
@ -388,7 +388,7 @@ message TxOutput {
reserved 7, 8, 9; // fields which are in use, or have been in the past, in TxOutputType
optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was present (used when creating a replacement transaction)
optional uint32 orig_index = 11; // index of the output in the original transaction (used when creating a replacement transaction)
optional uint32 payment_req_index = 12 [(experimental)=true]; // index of the PaymentRequest containing this output
optional uint32 payment_req_index = 12 [(experimental_field)=true]; // index of the PaymentRequest containing this output
}
/** Data type for metadata about previous transaction which contains the UTXO being spent.
@ -438,7 +438,7 @@ message PrevOutput {
* @next TxRequest
*/
message TxAckPaymentRequest {
option (unstable) = true;
option (experimental_message) = true;
optional bytes nonce = 1; // the nonce used in the signature computation
required string recipient_name = 2; // merchant's name

@ -456,7 +456,7 @@ message RebootToBootloader {
* @next Nonce
*/
message GetNonce {
option (unstable) = true;
option (experimental_message) = true;
}
/**
@ -464,7 +464,7 @@ message GetNonce {
* @end
*/
message Nonce {
option (unstable) = true;
option (experimental_message) = true;
required bytes nonce = 1; // a 32-byte random value generated by Trezor
}

@ -54,13 +54,13 @@ extend google.protobuf.EnumOptions {
/** Options for tagging message types */
extend google.protobuf.MessageOptions {
optional bool unstable = 52001; // indicate that a message is experimental, intended for development and beta testing only and its definition may change at any time
optional bool experimental_message = 52001; // indicate that a message is intended for development and beta testing only and its definition may change at any time
optional uint32 wire_type = 52002; // override wire type specified in the MessageType enum
}
/** Options for tagging field types */
extend google.protobuf.FieldOptions {
optional bool experimental = 53001; // indicate that a field is intended for development and beta testing only
optional bool experimental_field = 53001; // indicate that a field is intended for development and beta testing only
}
/** Options for tagging files with protobuf definitions */

@ -164,7 +164,7 @@ class ProtoField:
@property
def experimental(self):
return bool(self.extensions.get("experimental"))
return bool(self.extensions.get("experimental_field"))
@property
def is_message(self):
@ -573,7 +573,7 @@ class RustBlobRenderer:
raise ValueError("Unsupported wire type")
flags_and_wire_type = wire_type
if message.extensions.get("unstable"):
if message.extensions.get("experimental_message"):
flags_and_wire_type |= 0x8000
return flags_and_wire_type

@ -87,7 +87,7 @@ if TYPE_CHECKING:
...
# If set to False protobuf messages marked with "unstable" option are rejected.
# If set to False protobuf messages marked with "experimental_message" option are rejected.
experimental_enabled = False

@ -188,7 +188,6 @@ class _MessageTypeMeta(type):
class MessageType(metaclass=_MessageTypeMeta):
MESSAGE_WIRE_TYPE: Optional[int] = None
UNSTABLE: bool = False
FIELDS: Dict[int, Field] = {}

Loading…
Cancel
Save