1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00

chore(common): make unused fields optional

[no changelog]
This commit is contained in:
matejcik 2024-06-10 11:03:01 +02:00
parent e90cf36624
commit da75d8f4b6
4 changed files with 14 additions and 20 deletions

View File

@ -212,8 +212,8 @@ message SignTx {
required uint32 fee_rate = 1; // coordination fee rate in units of 10^-6 percent
required uint64 no_fee_threshold = 2; // PlebsDontPayThreshold in Wasabi, the input amount above which the fee rate applies
required uint64 min_registrable_amount = 3; // minimum registrable output amount
required bytes mask_public_key = 4; // ephemeral secp256k1 public key used for masking coinjoin_flags, 33 bytes in compressed form
required bytes signature = 5; // the trusted party's signature of the CoinJoin request digest
optional bytes mask_public_key = 4; // ephemeral secp256k1 public key used for masking coinjoin_flags, 33 bytes in compressed form
optional bytes signature = 5; // the trusted party's signature of the CoinJoin request digest
}
}

View File

@ -1005,8 +1005,8 @@ if TYPE_CHECKING:
fee_rate: "int"
no_fee_threshold: "int"
min_registrable_amount: "int"
mask_public_key: "bytes"
signature: "bytes"
mask_public_key: "bytes | None"
signature: "bytes | None"
def __init__(
self,
@ -1014,8 +1014,8 @@ if TYPE_CHECKING:
fee_rate: "int",
no_fee_threshold: "int",
min_registrable_amount: "int",
mask_public_key: "bytes",
signature: "bytes",
mask_public_key: "bytes | None" = None,
signature: "bytes | None" = None,
) -> None:
pass

View File

@ -1747,8 +1747,8 @@ class CoinJoinRequest(protobuf.MessageType):
1: protobuf.Field("fee_rate", "uint32", repeated=False, required=True),
2: protobuf.Field("no_fee_threshold", "uint64", repeated=False, required=True),
3: protobuf.Field("min_registrable_amount", "uint64", repeated=False, required=True),
4: protobuf.Field("mask_public_key", "bytes", repeated=False, required=True),
5: protobuf.Field("signature", "bytes", repeated=False, required=True),
4: protobuf.Field("mask_public_key", "bytes", repeated=False, required=False, default=None),
5: protobuf.Field("signature", "bytes", repeated=False, required=False, default=None),
}
def __init__(
@ -1757,8 +1757,8 @@ class CoinJoinRequest(protobuf.MessageType):
fee_rate: "int",
no_fee_threshold: "int",
min_registrable_amount: "int",
mask_public_key: "bytes",
signature: "bytes",
mask_public_key: Optional["bytes"] = None,
signature: Optional["bytes"] = None,
) -> None:
self.fee_rate = fee_rate
self.no_fee_threshold = no_fee_threshold

View File

@ -3705,7 +3705,7 @@ pub mod sign_tx {
self.min_registrable_amount = ::std::option::Option::Some(v);
}
// required bytes mask_public_key = 4;
// optional bytes mask_public_key = 4;
pub fn mask_public_key(&self) -> &[u8] {
match self.mask_public_key.as_ref() {
@ -3741,7 +3741,7 @@ pub mod sign_tx {
self.mask_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
// required bytes signature = 5;
// optional bytes signature = 5;
pub fn signature(&self) -> &[u8] {
match self.signature.as_ref() {
@ -3826,12 +3826,6 @@ pub mod sign_tx {
if self.min_registrable_amount.is_none() {
return false;
}
if self.mask_public_key.is_none() {
return false;
}
if self.signature.is_none() {
return false;
}
true
}
@ -13416,8 +13410,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
ify\x1a\xd2\x01\n\x0fCoinJoinRequest\x12\x19\n\x08fee_rate\x18\x01\x20\
\x02(\rR\x07feeRate\x12(\n\x10no_fee_threshold\x18\x02\x20\x02(\x04R\x0e\
noFeeThreshold\x124\n\x16min_registrable_amount\x18\x03\x20\x02(\x04R\
\x14minRegistrableAmount\x12&\n\x0fmask_public_key\x18\x04\x20\x02(\x0cR\
\rmaskPublicKey\x12\x1c\n\tsignature\x18\x05\x20\x02(\x0cR\tsignature\"\
\x14minRegistrableAmount\x12&\n\x0fmask_public_key\x18\x04\x20\x01(\x0cR\
\rmaskPublicKey\x12\x1c\n\tsignature\x18\x05\x20\x01(\x0cR\tsignature\"\
\xd4\x05\n\tTxRequest\x12T\n\x0crequest_type\x18\x01\x20\x01(\x0e21.hw.t\
rezor.messages.bitcoin.TxRequest.RequestTypeR\x0brequestType\x12T\n\x07d\
etails\x18\x02\x20\x01(\x0b2:.hw.trezor.messages.bitcoin.TxRequest.TxReq\