From ff702c7d7fc97489a17b0ae2b5780c0d4fe51fac Mon Sep 17 00:00:00 2001 From: matejcik Date: Mon, 10 Feb 2020 15:36:58 +0100 Subject: [PATCH] common: add proper markers for deprecated messages --- common/protob/messages-common.proto | 2 ++ common/protob/messages.proto | 4 ++-- legacy/firmware/protob/messages_map.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/protob/messages-common.proto b/common/protob/messages-common.proto index f5bf395b8e..6077840787 100644 --- a/common/protob/messages-common.proto +++ b/common/protob/messages-common.proto @@ -130,6 +130,7 @@ message PassphraseAck { * @next Deprecated_PassphraseStateAck */ message Deprecated_PassphraseStateRequest { + option deprecated = true; optional bytes state = 1; // actual device state } @@ -139,6 +140,7 @@ message Deprecated_PassphraseStateRequest { * @auxend */ message Deprecated_PassphraseStateAck { + option deprecated = true; } /** diff --git a/common/protob/messages.proto b/common/protob/messages.proto index e89f3facde..26b1f3a6eb 100644 --- a/common/protob/messages.proto +++ b/common/protob/messages.proto @@ -66,8 +66,8 @@ enum MessageType { // Deprecated messages, kept for protobuf compatibility. // Both are marked wire_out so that we don't need to implement incoming handler for legacy - MessageType_Deprecated_PassphraseStateRequest = 77 [(wire_out) = true]; - MessageType_Deprecated_PassphraseStateAck = 78 [(wire_out) = true]; + MessageType_Deprecated_PassphraseStateRequest = 77 [deprecated = true]; + MessageType_Deprecated_PassphraseStateAck = 78 [deprecated = true]; // Bootloader MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true]; diff --git a/legacy/firmware/protob/messages_map.py b/legacy/firmware/protob/messages_map.py index f82e17b100..231ee9d474 100755 --- a/legacy/firmware/protob/messages_map.py +++ b/legacy/firmware/protob/messages_map.py @@ -109,6 +109,8 @@ fl.write( messages = defaultdict(list) for message in MessageType.DESCRIPTOR.values: + if message.GetOptions().deprecated: + continue extension = get_wire_extension(message) messages[extension].append(message)