From dde4c12796eed93fbc7b05138ebf7bf94b8c40b8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 28 Aug 2019 09:25:11 +0200 Subject: [PATCH] common: add Feature.ShamirGroups to features --- common/protob/messages-management.proto | 1 + core/src/apps/homescreen/__init__.py | 8 +++++++- core/src/trezor/messages/Feature.py | 1 + core/src/trezor/messages/Features.py | 4 ++-- python/src/trezorlib/messages/Feature.py | 1 + python/src/trezorlib/messages/Features.py | 4 ++-- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto index 98282bb23..71f535f94 100644 --- a/common/protob/messages-management.proto +++ b/common/protob/messages-management.proto @@ -75,6 +75,7 @@ message Features { Feature_Tezos = 13; Feature_U2F = 14; Feature_Shamir = 15; + Feature_ShamirGroups = 16; } } diff --git a/core/src/apps/homescreen/__init__.py b/core/src/apps/homescreen/__init__.py index 1de344674..2b2c2d24a 100644 --- a/core/src/apps/homescreen/__init__.py +++ b/core/src/apps/homescreen/__init__.py @@ -37,7 +37,12 @@ def get_features() -> Features: f.flags = storage.device.get_flags() f.recovery_mode = storage.recovery.is_in_progress() if utils.BITCOIN_ONLY: - f.features = [Feature.Bitcoin, Feature.Crypto, Feature.Shamir] + f.features = [ + Feature.Bitcoin, + Feature.Crypto, + Feature.Shamir, + Feature.ShamirGroups, + ] else: f.features = [ Feature.Bitcoin, @@ -55,6 +60,7 @@ def get_features() -> Features: Feature.Tezos, Feature.U2F, Feature.Shamir, + Feature.ShamirGroups, ] return f diff --git a/core/src/trezor/messages/Feature.py b/core/src/trezor/messages/Feature.py index a71405d13..7ce3f05b6 100644 --- a/core/src/trezor/messages/Feature.py +++ b/core/src/trezor/messages/Feature.py @@ -19,3 +19,4 @@ if not utils.BITCOIN_ONLY: Tezos = 13 U2F = 14 Shamir = 15 +ShamirGroups = 16 diff --git a/core/src/trezor/messages/Features.py b/core/src/trezor/messages/Features.py index 338d65578..1556c1e6d 100644 --- a/core/src/trezor/messages/Features.py +++ b/core/src/trezor/messages/Features.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List, Optional from typing_extensions import Literal # noqa: F401 - EnumTypeFeature = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + EnumTypeFeature = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] except ImportError: Dict, List, Optional = None, None, None # type: ignore EnumTypeFeature = None # type: ignore @@ -108,5 +108,5 @@ class Features(p.MessageType): 27: ('unfinished_backup', p.BoolType, 0), 28: ('no_backup', p.BoolType, 0), 29: ('recovery_mode', p.BoolType, 0), - 30: ('features', p.EnumType("Feature", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)), p.FLAG_REPEATED), + 30: ('features', p.EnumType("Feature", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)), p.FLAG_REPEATED), } diff --git a/python/src/trezorlib/messages/Feature.py b/python/src/trezorlib/messages/Feature.py index d170a1de3..5f8069198 100644 --- a/python/src/trezorlib/messages/Feature.py +++ b/python/src/trezorlib/messages/Feature.py @@ -15,3 +15,4 @@ Stellar = 12 Tezos = 13 U2F = 14 Shamir = 15 +ShamirGroups = 16 diff --git a/python/src/trezorlib/messages/Features.py b/python/src/trezorlib/messages/Features.py index 8c12a96ae..5e22895df 100644 --- a/python/src/trezorlib/messages/Features.py +++ b/python/src/trezorlib/messages/Features.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List, Optional from typing_extensions import Literal # noqa: F401 - EnumTypeFeature = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + EnumTypeFeature = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] except ImportError: Dict, List, Optional = None, None, None # type: ignore EnumTypeFeature = None # type: ignore @@ -108,5 +108,5 @@ class Features(p.MessageType): 27: ('unfinished_backup', p.BoolType, 0), 28: ('no_backup', p.BoolType, 0), 29: ('recovery_mode', p.BoolType, 0), - 30: ('features', p.EnumType("Feature", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)), p.FLAG_REPEATED), + 30: ('features', p.EnumType("Feature", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)), p.FLAG_REPEATED), }