mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
common: add PromptTemporarily to SafetyChecks enum
This commit is contained in:
parent
9d2ad96ad4
commit
7d37b2c90f
@ -18,8 +18,9 @@ enum BackupType {
|
||||
* Level of safety checks for unsafe actions like spending from invalid path namespace or setting high transaction fee.
|
||||
*/
|
||||
enum SafetyCheckLevel {
|
||||
Strict = 0; // disallow unsafe actions
|
||||
Prompt = 1; // ask user before unsafe action
|
||||
Strict = 0; // disallow unsafe actions, this is the default
|
||||
PromptAlways = 1; // ask user before unsafe action
|
||||
PromptTemporarily = 2; // like PromptAlways but reverts to Strict after reboot
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,7 +99,7 @@ message Features {
|
||||
optional bool wipe_code_protection = 34; // is wipe code protection enabled
|
||||
optional bytes session_id = 35;
|
||||
optional bool passphrase_always_on_device = 36; // device enforces passphrase entry on Trezor
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@ if __debug__:
|
||||
try:
|
||||
from typing import Dict, List # noqa: F401
|
||||
from typing_extensions import Literal # noqa: F401
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1, 2]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -44,5 +44,5 @@ class ApplySettings(p.MessageType):
|
||||
6: ('auto_lock_delay_ms', p.UVarintType, 0),
|
||||
7: ('display_rotation', p.UVarintType, 0),
|
||||
8: ('passphrase_always_on_device', p.BoolType, 0),
|
||||
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0),
|
||||
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ if __debug__:
|
||||
from typing_extensions import Literal # noqa: F401
|
||||
EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||
EnumTypeBackupType = Literal[0, 1, 2]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1, 2]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -127,5 +127,5 @@ class Features(p.MessageType):
|
||||
34: ('wipe_code_protection', p.BoolType, 0),
|
||||
35: ('session_id', p.BytesType, 0),
|
||||
36: ('passphrase_always_on_device', p.BoolType, 0),
|
||||
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0),
|
||||
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0),
|
||||
}
|
||||
|
@ -4,4 +4,5 @@ if False:
|
||||
from typing_extensions import Literal
|
||||
|
||||
Strict = 0 # type: Literal[0]
|
||||
Prompt = 1 # type: Literal[1]
|
||||
PromptAlways = 1 # type: Literal[1]
|
||||
PromptTemporarily = 2 # type: Literal[2]
|
||||
|
@ -6,7 +6,7 @@ if __debug__:
|
||||
try:
|
||||
from typing import Dict, List # noqa: F401
|
||||
from typing_extensions import Literal # noqa: F401
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1, 2]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -44,5 +44,5 @@ class ApplySettings(p.MessageType):
|
||||
6: ('auto_lock_delay_ms', p.UVarintType, 0),
|
||||
7: ('display_rotation', p.UVarintType, 0),
|
||||
8: ('passphrase_always_on_device', p.BoolType, 0),
|
||||
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0),
|
||||
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ if __debug__:
|
||||
from typing_extensions import Literal # noqa: F401
|
||||
EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||
EnumTypeBackupType = Literal[0, 1, 2]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1]
|
||||
EnumTypeSafetyCheckLevel = Literal[0, 1, 2]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -127,5 +127,5 @@ class Features(p.MessageType):
|
||||
34: ('wipe_code_protection', p.BoolType, 0),
|
||||
35: ('session_id', p.BytesType, 0),
|
||||
36: ('passphrase_always_on_device', p.BoolType, 0),
|
||||
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0),
|
||||
37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0),
|
||||
}
|
||||
|
@ -4,4 +4,5 @@ if False:
|
||||
from typing_extensions import Literal
|
||||
|
||||
Strict = 0 # type: Literal[0]
|
||||
Prompt = 1 # type: Literal[1]
|
||||
PromptAlways = 1 # type: Literal[1]
|
||||
PromptTemporarily = 2 # type: Literal[2]
|
||||
|
Loading…
Reference in New Issue
Block a user