Function encode_message
pub fn encode_message<let N: u32>(
msg_type: u64,
msg_metadata: u64,
msg_content: [Field; N],
) -> [Field; N + 1]
pub fn encode_message<let N: u32>(
msg_type: u64,
msg_metadata: u64,
msg_content: [Field; N],
) -> [Field; N + 1]
Encodes a message following aztec-nr's standard message encoding. This message can later be decoded with
decode_messageto retrieve the original values.msg_typeis an identifier that groups types of messages that are all processed the same way, e.g. private notes or events. Possible values are defined inaztec::messages::msg_type.msg_metadataandmsg_contentare the values stored in the message, whose meaning depends on themsg_type. The only special thing aboutmsg_metadatathat separates it frommsg_contentis that it is a u64 instead of a full Field (due to details of how messages are encoded), allowing applications that can fit values into this smaller variable to achieve higher data efficiency.