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

chore(proto): remove default value from NEM payload

[no changelog]
This commit is contained in:
grdddj 2022-10-27 10:30:59 +02:00 committed by matejcik
parent fd1fbc9372
commit 47a749d683
4 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ message NEMSignTx {
message NEMTransfer {
required string recipient = 1; // Address of the recipient
required uint64 amount = 2; // Amount of micro NEM that is transferred
optional bytes payload = 3 [default=""]; // Actual message data (unencrypted)
optional bytes payload = 3; // Actual message data (unencrypted)
optional bytes public_key = 4; // Public key of the recipient (for encrypted payloads)
repeated NEMMosaic mosaics = 5; // Attached mosaics
/**

View File

@ -93,7 +93,7 @@ def get_transfer_payload(
encrypted_payload = _encrypt(node, transfer.public_key, transfer.payload)
return encrypted_payload, True
else:
return transfer.payload, False
return transfer.payload or b"", False
def _encrypt(node: bip32.HDNode, public_key: bytes, payload: bytes) -> bytes:

View File

@ -4722,7 +4722,7 @@ if TYPE_CHECKING:
class NEMTransfer(protobuf.MessageType):
recipient: "str"
amount: "int"
payload: "bytes"
payload: "bytes | None"
public_key: "bytes | None"
mosaics: "list[NEMMosaic]"

View File

@ -6064,7 +6064,7 @@ class NEMTransfer(protobuf.MessageType):
FIELDS = {
1: protobuf.Field("recipient", "string", repeated=False, required=True),
2: protobuf.Field("amount", "uint64", repeated=False, required=True),
3: protobuf.Field("payload", "bytes", repeated=False, required=False, default=b''),
3: protobuf.Field("payload", "bytes", repeated=False, required=False, default=None),
4: protobuf.Field("public_key", "bytes", repeated=False, required=False, default=None),
5: protobuf.Field("mosaics", "NEMMosaic", repeated=True, required=False, default=None),
}
@ -6075,7 +6075,7 @@ class NEMTransfer(protobuf.MessageType):
recipient: "str",
amount: "int",
mosaics: Optional[Sequence["NEMMosaic"]] = None,
payload: Optional["bytes"] = b'',
payload: Optional["bytes"] = None,
public_key: Optional["bytes"] = None,
) -> None:
self.mosaics: Sequence["NEMMosaic"] = mosaics if mosaics is not None else []