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

feat(common): add experimental_features setting

This commit is contained in:
Martin Milata 2020-10-04 22:53:42 +02:00 committed by Tomas Susanka
parent 865c167ac5
commit 314cd260eb
5 changed files with 14 additions and 0 deletions

View File

@ -102,6 +102,7 @@ message Features {
optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement
optional uint32 auto_lock_delay_ms = 38; // number of milliseconds after which the device locks itself optional uint32 auto_lock_delay_ms = 38; // number of milliseconds after which the device locks itself
optional uint32 display_rotation = 39; // in degrees from North optional uint32 display_rotation = 39; // in degrees from North
optional bool experimental_features = 40; // are experimental message types enabled?
} }
/** /**
@ -138,6 +139,7 @@ message ApplySettings {
optional uint32 display_rotation = 7; // in degrees from North optional uint32 display_rotation = 7; // in degrees from North
optional bool passphrase_always_on_device = 8; // do not prompt for passphrase, enforce device entry optional bool passphrase_always_on_device = 8; // do not prompt for passphrase, enforce device entry
optional SafetyCheckLevel safety_checks = 9; // Safety check level, set to Prompt to limit path namespace enforcement optional SafetyCheckLevel safety_checks = 9; // Safety check level, set to Prompt to limit path namespace enforcement
optional bool experimental_features = 10; // enable experimental message types
} }
/** /**

View File

@ -25,6 +25,7 @@ class ApplySettings(p.MessageType):
display_rotation: int = None, display_rotation: int = None,
passphrase_always_on_device: bool = None, passphrase_always_on_device: bool = None,
safety_checks: EnumTypeSafetyCheckLevel = None, safety_checks: EnumTypeSafetyCheckLevel = None,
experimental_features: bool = None,
) -> None: ) -> None:
self.language = language self.language = language
self.label = label self.label = label
@ -34,6 +35,7 @@ class ApplySettings(p.MessageType):
self.display_rotation = display_rotation self.display_rotation = display_rotation
self.passphrase_always_on_device = passphrase_always_on_device self.passphrase_always_on_device = passphrase_always_on_device
self.safety_checks = safety_checks self.safety_checks = safety_checks
self.experimental_features = experimental_features
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
@ -46,4 +48,5 @@ class ApplySettings(p.MessageType):
7: ('display_rotation', p.UVarintType, None), 7: ('display_rotation', p.UVarintType, None),
8: ('passphrase_always_on_device', p.BoolType, None), 8: ('passphrase_always_on_device', p.BoolType, None),
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None), 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None),
10: ('experimental_features', p.BoolType, None),
} }

View File

@ -56,6 +56,7 @@ class Features(p.MessageType):
safety_checks: EnumTypeSafetyCheckLevel = None, safety_checks: EnumTypeSafetyCheckLevel = None,
auto_lock_delay_ms: int = None, auto_lock_delay_ms: int = None,
display_rotation: int = None, display_rotation: int = None,
experimental_features: bool = None,
) -> None: ) -> None:
self.capabilities = capabilities if capabilities is not None else [] self.capabilities = capabilities if capabilities is not None else []
self.vendor = vendor self.vendor = vendor
@ -94,6 +95,7 @@ class Features(p.MessageType):
self.safety_checks = safety_checks self.safety_checks = safety_checks
self.auto_lock_delay_ms = auto_lock_delay_ms self.auto_lock_delay_ms = auto_lock_delay_ms
self.display_rotation = display_rotation self.display_rotation = display_rotation
self.experimental_features = experimental_features
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
@ -135,4 +137,5 @@ class Features(p.MessageType):
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None), 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None),
38: ('auto_lock_delay_ms', p.UVarintType, None), 38: ('auto_lock_delay_ms', p.UVarintType, None),
39: ('display_rotation', p.UVarintType, None), 39: ('display_rotation', p.UVarintType, None),
40: ('experimental_features', p.BoolType, None),
} }

View File

@ -25,6 +25,7 @@ class ApplySettings(p.MessageType):
display_rotation: int = None, display_rotation: int = None,
passphrase_always_on_device: bool = None, passphrase_always_on_device: bool = None,
safety_checks: EnumTypeSafetyCheckLevel = None, safety_checks: EnumTypeSafetyCheckLevel = None,
experimental_features: bool = None,
) -> None: ) -> None:
self.language = language self.language = language
self.label = label self.label = label
@ -34,6 +35,7 @@ class ApplySettings(p.MessageType):
self.display_rotation = display_rotation self.display_rotation = display_rotation
self.passphrase_always_on_device = passphrase_always_on_device self.passphrase_always_on_device = passphrase_always_on_device
self.safety_checks = safety_checks self.safety_checks = safety_checks
self.experimental_features = experimental_features
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
@ -46,4 +48,5 @@ class ApplySettings(p.MessageType):
7: ('display_rotation', p.UVarintType, None), 7: ('display_rotation', p.UVarintType, None),
8: ('passphrase_always_on_device', p.BoolType, None), 8: ('passphrase_always_on_device', p.BoolType, None),
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None), 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None),
10: ('experimental_features', p.BoolType, None),
} }

View File

@ -56,6 +56,7 @@ class Features(p.MessageType):
safety_checks: EnumTypeSafetyCheckLevel = None, safety_checks: EnumTypeSafetyCheckLevel = None,
auto_lock_delay_ms: int = None, auto_lock_delay_ms: int = None,
display_rotation: int = None, display_rotation: int = None,
experimental_features: bool = None,
) -> None: ) -> None:
self.capabilities = capabilities if capabilities is not None else [] self.capabilities = capabilities if capabilities is not None else []
self.vendor = vendor self.vendor = vendor
@ -94,6 +95,7 @@ class Features(p.MessageType):
self.safety_checks = safety_checks self.safety_checks = safety_checks
self.auto_lock_delay_ms = auto_lock_delay_ms self.auto_lock_delay_ms = auto_lock_delay_ms
self.display_rotation = display_rotation self.display_rotation = display_rotation
self.experimental_features = experimental_features
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
@ -135,4 +137,5 @@ class Features(p.MessageType):
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None), 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), None),
38: ('auto_lock_delay_ms', p.UVarintType, None), 38: ('auto_lock_delay_ms', p.UVarintType, None),
39: ('display_rotation', p.UVarintType, None), 39: ('display_rotation', p.UVarintType, None),
40: ('experimental_features', p.BoolType, None),
} }