From 0376670404fe7cd07b0913ac847c629d92411e60 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Wed, 7 Oct 2020 00:59:35 +0200 Subject: [PATCH] feat(common): expose 'unstable' option in generated code --- common/protob/pb2py | 5 +++++ core/src/trezor/messages/AuthorizeCoinJoin.py | 1 + python/src/trezorlib/messages/AuthorizeCoinJoin.py | 1 + 3 files changed, 7 insertions(+) diff --git a/common/protob/pb2py b/common/protob/pb2py index 09feef39c..8b8196df4 100755 --- a/common/protob/pb2py +++ b/common/protob/pb2py @@ -327,6 +327,8 @@ class Descriptor: if msg_id is None: msg_id = self.message_types.get(message.name) + unstable = self._get_extension(message, "unstable") + # "from .. import protobuf as p" yield self.protobuf_import + " as p" @@ -358,6 +360,9 @@ class Descriptor: if msg_id is not None: yield " MESSAGE_WIRE_TYPE = {}".format(msg_id) + if unstable is not None: + yield " UNSTABLE = True" + if fields: yield "" yield from self.create_init_method(fields) diff --git a/core/src/trezor/messages/AuthorizeCoinJoin.py b/core/src/trezor/messages/AuthorizeCoinJoin.py index d0c0995ef..d1959a1ab 100644 --- a/core/src/trezor/messages/AuthorizeCoinJoin.py +++ b/core/src/trezor/messages/AuthorizeCoinJoin.py @@ -13,6 +13,7 @@ if __debug__: class AuthorizeCoinJoin(p.MessageType): MESSAGE_WIRE_TYPE = 51 + UNSTABLE = True def __init__( self, diff --git a/python/src/trezorlib/messages/AuthorizeCoinJoin.py b/python/src/trezorlib/messages/AuthorizeCoinJoin.py index c27daf952..f9c9e7a9e 100644 --- a/python/src/trezorlib/messages/AuthorizeCoinJoin.py +++ b/python/src/trezorlib/messages/AuthorizeCoinJoin.py @@ -13,6 +13,7 @@ if __debug__: class AuthorizeCoinJoin(p.MessageType): MESSAGE_WIRE_TYPE = 51 + UNSTABLE = True def __init__( self,