mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-29 00:31:02 +00:00
common/protobuf: set mnemonic as repeated in LoadDevice for SLIP-39 support
This commit is contained in:
parent
f6d127523e
commit
e95a97f281
@ -165,7 +165,7 @@ message WipeDevice {
|
|||||||
* @next Failure
|
* @next Failure
|
||||||
*/
|
*/
|
||||||
message LoadDevice {
|
message LoadDevice {
|
||||||
optional string mnemonic = 1; // seed encoded as BIP-39 mnemonic (12, 18 or 24 words)
|
repeated string mnemonics = 1; // seed encoded as mnemonic (12, 18 or 24 words for BIP39, 20 or 33 for SLIP39)
|
||||||
optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 node
|
optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 node
|
||||||
optional string pin = 3; // set PIN protection
|
optional string pin = 3; // set PIN protection
|
||||||
optional bool passphrase_protection = 4; // enable master node encryption using passphrase
|
optional bool passphrase_protection = 4; // enable master node encryption using passphrase
|
||||||
|
@ -16,7 +16,7 @@ class LoadDevice(p.MessageType):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
mnemonic: str = None,
|
mnemonics: List[str] = None,
|
||||||
node: HDNodeType = None,
|
node: HDNodeType = None,
|
||||||
pin: str = None,
|
pin: str = None,
|
||||||
passphrase_protection: bool = None,
|
passphrase_protection: bool = None,
|
||||||
@ -25,7 +25,7 @@ class LoadDevice(p.MessageType):
|
|||||||
skip_checksum: bool = None,
|
skip_checksum: bool = None,
|
||||||
u2f_counter: int = None,
|
u2f_counter: int = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.mnemonic = mnemonic
|
self.mnemonics = mnemonics if mnemonics is not None else []
|
||||||
self.node = node
|
self.node = node
|
||||||
self.pin = pin
|
self.pin = pin
|
||||||
self.passphrase_protection = passphrase_protection
|
self.passphrase_protection = passphrase_protection
|
||||||
@ -37,7 +37,7 @@ class LoadDevice(p.MessageType):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
return {
|
return {
|
||||||
1: ('mnemonic', p.UnicodeType, 0),
|
1: ('mnemonics', p.UnicodeType, p.FLAG_REPEATED),
|
||||||
2: ('node', HDNodeType, 0),
|
2: ('node', HDNodeType, 0),
|
||||||
3: ('pin', p.UnicodeType, 0),
|
3: ('pin', p.UnicodeType, 0),
|
||||||
4: ('passphrase_protection', p.BoolType, 0),
|
4: ('passphrase_protection', p.BoolType, 0),
|
||||||
|
@ -16,7 +16,7 @@ class LoadDevice(p.MessageType):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
mnemonic: str = None,
|
mnemonics: List[str] = None,
|
||||||
node: HDNodeType = None,
|
node: HDNodeType = None,
|
||||||
pin: str = None,
|
pin: str = None,
|
||||||
passphrase_protection: bool = None,
|
passphrase_protection: bool = None,
|
||||||
@ -25,7 +25,7 @@ class LoadDevice(p.MessageType):
|
|||||||
skip_checksum: bool = None,
|
skip_checksum: bool = None,
|
||||||
u2f_counter: int = None,
|
u2f_counter: int = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.mnemonic = mnemonic
|
self.mnemonics = mnemonics if mnemonics is not None else []
|
||||||
self.node = node
|
self.node = node
|
||||||
self.pin = pin
|
self.pin = pin
|
||||||
self.passphrase_protection = passphrase_protection
|
self.passphrase_protection = passphrase_protection
|
||||||
@ -37,7 +37,7 @@ class LoadDevice(p.MessageType):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
return {
|
return {
|
||||||
1: ('mnemonic', p.UnicodeType, 0),
|
1: ('mnemonics', p.UnicodeType, p.FLAG_REPEATED),
|
||||||
2: ('node', HDNodeType, 0),
|
2: ('node', HDNodeType, 0),
|
||||||
3: ('pin', p.UnicodeType, 0),
|
3: ('pin', p.UnicodeType, 0),
|
||||||
4: ('passphrase_protection', p.BoolType, 0),
|
4: ('passphrase_protection', p.BoolType, 0),
|
||||||
|
Loading…
Reference in New Issue
Block a user