mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-22 12:32:02 +00:00
fix(all): make more protobuf fields required
[no changelog]
This commit is contained in:
parent
c7231e5de9
commit
8b6d8e7572
@ -651,7 +651,7 @@ message UnlockPath {
|
|||||||
* @next GetAddress
|
* @next GetAddress
|
||||||
*/
|
*/
|
||||||
message UnlockedPathRequest {
|
message UnlockedPathRequest {
|
||||||
optional bytes mac = 1; // authentication code for future UnlockPath calls
|
required bytes mac = 1; // authentication code for future UnlockPath calls
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,7 +98,7 @@ message MoneroGetAddress {
|
|||||||
* @end
|
* @end
|
||||||
*/
|
*/
|
||||||
message MoneroAddress {
|
message MoneroAddress {
|
||||||
optional bytes address = 1;
|
required bytes address = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,8 +117,8 @@ message MoneroGetWatchKey {
|
|||||||
* @end
|
* @end
|
||||||
*/
|
*/
|
||||||
message MoneroWatchKey {
|
message MoneroWatchKey {
|
||||||
optional bytes watch_key = 1;
|
required bytes watch_key = 1;
|
||||||
optional bytes address = 2;
|
required bytes address = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
16
core/src/trezor/messages.py
generated
16
core/src/trezor/messages.py
generated
@ -2785,12 +2785,12 @@ if TYPE_CHECKING:
|
|||||||
return isinstance(msg, cls)
|
return isinstance(msg, cls)
|
||||||
|
|
||||||
class UnlockedPathRequest(protobuf.MessageType):
|
class UnlockedPathRequest(protobuf.MessageType):
|
||||||
mac: "bytes | None"
|
mac: "bytes"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
mac: "bytes | None" = None,
|
mac: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -4141,12 +4141,12 @@ if TYPE_CHECKING:
|
|||||||
return isinstance(msg, cls)
|
return isinstance(msg, cls)
|
||||||
|
|
||||||
class MoneroAddress(protobuf.MessageType):
|
class MoneroAddress(protobuf.MessageType):
|
||||||
address: "bytes | None"
|
address: "bytes"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
address: "bytes | None" = None,
|
address: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -4171,14 +4171,14 @@ if TYPE_CHECKING:
|
|||||||
return isinstance(msg, cls)
|
return isinstance(msg, cls)
|
||||||
|
|
||||||
class MoneroWatchKey(protobuf.MessageType):
|
class MoneroWatchKey(protobuf.MessageType):
|
||||||
watch_key: "bytes | None"
|
watch_key: "bytes"
|
||||||
address: "bytes | None"
|
address: "bytes"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
watch_key: "bytes | None" = None,
|
watch_key: "bytes",
|
||||||
address: "bytes | None" = None,
|
address: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -862,7 +862,6 @@ void fsm_msgUnlockPath(const UnlockPath *msg) {
|
|||||||
|
|
||||||
unlock_path = msg->address_n[0];
|
unlock_path = msg->address_n[0];
|
||||||
resp->mac.size = SHA256_DIGEST_LENGTH;
|
resp->mac.size = SHA256_DIGEST_LENGTH;
|
||||||
resp->has_mac = true;
|
|
||||||
msg_write(MessageType_MessageType_UnlockedPathRequest, resp);
|
msg_write(MessageType_MessageType_UnlockedPathRequest, resp);
|
||||||
layoutHome();
|
layoutHome();
|
||||||
}
|
}
|
||||||
|
16
python/src/trezorlib/messages.py
generated
16
python/src/trezorlib/messages.py
generated
@ -4000,13 +4000,13 @@ class UnlockPath(protobuf.MessageType):
|
|||||||
class UnlockedPathRequest(protobuf.MessageType):
|
class UnlockedPathRequest(protobuf.MessageType):
|
||||||
MESSAGE_WIRE_TYPE = 94
|
MESSAGE_WIRE_TYPE = 94
|
||||||
FIELDS = {
|
FIELDS = {
|
||||||
1: protobuf.Field("mac", "bytes", repeated=False, required=False, default=None),
|
1: protobuf.Field("mac", "bytes", repeated=False, required=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
mac: Optional["bytes"] = None,
|
mac: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
self.mac = mac
|
self.mac = mac
|
||||||
|
|
||||||
@ -5568,13 +5568,13 @@ class MoneroGetAddress(protobuf.MessageType):
|
|||||||
class MoneroAddress(protobuf.MessageType):
|
class MoneroAddress(protobuf.MessageType):
|
||||||
MESSAGE_WIRE_TYPE = 541
|
MESSAGE_WIRE_TYPE = 541
|
||||||
FIELDS = {
|
FIELDS = {
|
||||||
1: protobuf.Field("address", "bytes", repeated=False, required=False, default=None),
|
1: protobuf.Field("address", "bytes", repeated=False, required=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
address: Optional["bytes"] = None,
|
address: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
self.address = address
|
self.address = address
|
||||||
|
|
||||||
@ -5599,15 +5599,15 @@ class MoneroGetWatchKey(protobuf.MessageType):
|
|||||||
class MoneroWatchKey(protobuf.MessageType):
|
class MoneroWatchKey(protobuf.MessageType):
|
||||||
MESSAGE_WIRE_TYPE = 543
|
MESSAGE_WIRE_TYPE = 543
|
||||||
FIELDS = {
|
FIELDS = {
|
||||||
1: protobuf.Field("watch_key", "bytes", repeated=False, required=False, default=None),
|
1: protobuf.Field("watch_key", "bytes", repeated=False, required=True),
|
||||||
2: protobuf.Field("address", "bytes", repeated=False, required=False, default=None),
|
2: protobuf.Field("address", "bytes", repeated=False, required=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
watch_key: Optional["bytes"] = None,
|
watch_key: "bytes",
|
||||||
address: Optional["bytes"] = None,
|
address: "bytes",
|
||||||
) -> None:
|
) -> None:
|
||||||
self.watch_key = watch_key
|
self.watch_key = watch_key
|
||||||
self.address = address
|
self.address = address
|
||||||
|
@ -10709,7 +10709,7 @@ impl UnlockedPathRequest {
|
|||||||
::std::default::Default::default()
|
::std::default::Default::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional bytes mac = 1;
|
// required bytes mac = 1;
|
||||||
|
|
||||||
pub fn mac(&self) -> &[u8] {
|
pub fn mac(&self) -> &[u8] {
|
||||||
match self.mac.as_ref() {
|
match self.mac.as_ref() {
|
||||||
@ -10765,6 +10765,9 @@ impl ::protobuf::Message for UnlockedPathRequest {
|
|||||||
const NAME: &'static str = "UnlockedPathRequest";
|
const NAME: &'static str = "UnlockedPathRequest";
|
||||||
|
|
||||||
fn is_initialized(&self) -> bool {
|
fn is_initialized(&self) -> bool {
|
||||||
|
if self.mac.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11724,7 +11727,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
|||||||
\n\x05Nonce\x12\x14\n\x05nonce\x18\x01\x20\x02(\x0cR\x05nonce:\x04\x88\
|
\n\x05Nonce\x12\x14\n\x05nonce\x18\x01\x20\x02(\x0cR\x05nonce:\x04\x88\
|
||||||
\xb2\x19\x01\";\n\nUnlockPath\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\
|
\xb2\x19\x01\";\n\nUnlockPath\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\
|
||||||
\x08addressN\x12\x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac\"'\n\x13Unloc\
|
\x08addressN\x12\x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac\"'\n\x13Unloc\
|
||||||
kedPathRequest\x12\x10\n\x03mac\x18\x01\x20\x01(\x0cR\x03mac\"\x14\n\x12\
|
kedPathRequest\x12\x10\n\x03mac\x18\x01\x20\x02(\x0cR\x03mac\"\x14\n\x12\
|
||||||
ShowDeviceTutorial\"\x12\n\x10UnlockBootloader\"%\n\rSetBrightness\x12\
|
ShowDeviceTutorial\"\x12\n\x10UnlockBootloader\"%\n\rSetBrightness\x12\
|
||||||
\x14\n\x05value\x18\x01\x20\x01(\rR\x05value*\x99\x01\n\nBackupType\x12\
|
\x14\n\x05value\x18\x01\x20\x01(\rR\x05value*\x99\x01\n\nBackupType\x12\
|
||||||
\t\n\x05Bip39\x10\0\x12\x10\n\x0cSlip39_Basic\x10\x01\x12\x13\n\x0fSlip3\
|
\t\n\x05Bip39\x10\0\x12\x10\n\x0cSlip39_Basic\x10\x01\x12\x13\n\x0fSlip3\
|
||||||
|
@ -2451,7 +2451,7 @@ impl MoneroAddress {
|
|||||||
::std::default::Default::default()
|
::std::default::Default::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional bytes address = 1;
|
// required bytes address = 1;
|
||||||
|
|
||||||
pub fn address(&self) -> &[u8] {
|
pub fn address(&self) -> &[u8] {
|
||||||
match self.address.as_ref() {
|
match self.address.as_ref() {
|
||||||
@ -2507,6 +2507,9 @@ impl ::protobuf::Message for MoneroAddress {
|
|||||||
const NAME: &'static str = "MoneroAddress";
|
const NAME: &'static str = "MoneroAddress";
|
||||||
|
|
||||||
fn is_initialized(&self) -> bool {
|
fn is_initialized(&self) -> bool {
|
||||||
|
if self.address.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2776,7 +2779,7 @@ impl MoneroWatchKey {
|
|||||||
::std::default::Default::default()
|
::std::default::Default::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional bytes watch_key = 1;
|
// required bytes watch_key = 1;
|
||||||
|
|
||||||
pub fn watch_key(&self) -> &[u8] {
|
pub fn watch_key(&self) -> &[u8] {
|
||||||
match self.watch_key.as_ref() {
|
match self.watch_key.as_ref() {
|
||||||
@ -2812,7 +2815,7 @@ impl MoneroWatchKey {
|
|||||||
self.watch_key.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
self.watch_key.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional bytes address = 2;
|
// required bytes address = 2;
|
||||||
|
|
||||||
pub fn address(&self) -> &[u8] {
|
pub fn address(&self) -> &[u8] {
|
||||||
match self.address.as_ref() {
|
match self.address.as_ref() {
|
||||||
@ -2873,6 +2876,12 @@ impl ::protobuf::Message for MoneroWatchKey {
|
|||||||
const NAME: &'static str = "MoneroWatchKey";
|
const NAME: &'static str = "MoneroWatchKey";
|
||||||
|
|
||||||
fn is_initialized(&self) -> bool {
|
fn is_initialized(&self) -> bool {
|
||||||
|
if self.watch_key.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if self.address.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11845,11 +11854,11 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
|||||||
unt\x12\x14\n\x05minor\x18\x05\x20\x01(\rR\x05minor\x12\x1d\n\npayment_i\
|
unt\x12\x14\n\x05minor\x18\x05\x20\x01(\rR\x05minor\x12\x1d\n\npayment_i\
|
||||||
d\x18\x06\x20\x01(\x0cR\tpaymentId\x12\x1a\n\x08chunkify\x18\x07\x20\x01\
|
d\x18\x06\x20\x01(\x0cR\tpaymentId\x12\x1a\n\x08chunkify\x18\x07\x20\x01\
|
||||||
(\x08R\x08chunkify\")\n\rMoneroAddress\x12\x18\n\x07address\x18\x01\x20\
|
(\x08R\x08chunkify\")\n\rMoneroAddress\x12\x18\n\x07address\x18\x01\x20\
|
||||||
\x01(\x0cR\x07address\"\x8a\x01\n\x11MoneroGetWatchKey\x12\x1b\n\taddres\
|
\x02(\x0cR\x07address\"\x8a\x01\n\x11MoneroGetWatchKey\x12\x1b\n\taddres\
|
||||||
s_n\x18\x01\x20\x03(\rR\x08addressN\x12X\n\x0cnetwork_type\x18\x02\x20\
|
s_n\x18\x01\x20\x03(\rR\x08addressN\x12X\n\x0cnetwork_type\x18\x02\x20\
|
||||||
\x01(\x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07MAINNETR\x0b\
|
\x01(\x0e2,.hw.trezor.messages.monero.MoneroNetworkType:\x07MAINNETR\x0b\
|
||||||
networkType\"G\n\x0eMoneroWatchKey\x12\x1b\n\twatch_key\x18\x01\x20\x01(\
|
networkType\"G\n\x0eMoneroWatchKey\x12\x1b\n\twatch_key\x18\x01\x20\x02(\
|
||||||
\x0cR\x08watchKey\x12\x18\n\x07address\x18\x02\x20\x01(\x0cR\x07address\
|
\x0cR\x08watchKey\x12\x18\n\x07address\x18\x02\x20\x02(\x0cR\x07address\
|
||||||
\"\xd1\x07\n\x1cMoneroTransactionInitRequest\x12\x18\n\x07version\x18\
|
\"\xd1\x07\n\x1cMoneroTransactionInitRequest\x12\x18\n\x07version\x18\
|
||||||
\x01\x20\x01(\rR\x07version\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08\
|
\x01\x20\x01(\rR\x07version\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08\
|
||||||
addressN\x12X\n\x0cnetwork_type\x18\x03\x20\x01(\x0e2,.hw.trezor.message\
|
addressN\x12X\n\x0cnetwork_type\x18\x03\x20\x01(\x0e2,.hw.trezor.message\
|
||||||
|
Loading…
Reference in New Issue
Block a user