mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-12 17:48:09 +00:00
chore(core): allow encoding protobuf into memoryview
[no changelog]
This commit is contained in:
parent
28b30128de
commit
834d556b9c
@ -356,7 +356,7 @@ pub static mp_module_trezorproto: Module = obj_module! {
|
|||||||
/// """Calculate length of encoding of the specified message."""
|
/// """Calculate length of encoding of the specified message."""
|
||||||
Qstr::MP_QSTR_encoded_length => obj_fn_1!(protobuf_len).as_obj(),
|
Qstr::MP_QSTR_encoded_length => obj_fn_1!(protobuf_len).as_obj(),
|
||||||
|
|
||||||
/// def encode(buffer: bytearray, msg: MessageType) -> int:
|
/// def encode(buffer: bytearray | memoryview, msg: MessageType) -> int:
|
||||||
/// """Encode the message into the specified buffer. Return length of
|
/// """Encode the message into the specified buffer. Return length of
|
||||||
/// encoding."""
|
/// encoding."""
|
||||||
Qstr::MP_QSTR_encode => obj_fn_2!(protobuf_encode).as_obj()
|
Qstr::MP_QSTR_encode => obj_fn_2!(protobuf_encode).as_obj()
|
||||||
|
@ -42,6 +42,6 @@ def encoded_length(msg: MessageType) -> int:
|
|||||||
|
|
||||||
|
|
||||||
# rust/src/protobuf/obj.rs
|
# rust/src/protobuf/obj.rs
|
||||||
def encode(buffer: bytearray, msg: MessageType) -> int:
|
def encode(buffer: bytearray | memoryview, msg: MessageType) -> int:
|
||||||
"""Encode the message into the specified buffer. Return length of
|
"""Encode the message into the specified buffer. Return length of
|
||||||
encoding."""
|
encoding."""
|
||||||
|
Loading…
Reference in New Issue
Block a user