Skip to main content
Version: v0.85.0-alpha-testnet.0

encoding

Standalone Functions

encode_message

encode_message(msg_type, msg_metadata, msg_content, );

/ this smaller variable to achieve higher data efficiency.

Parameters

NameType
msg_typeu64
msg_metadatau64
msg_content[Field; N]

decode_message

decode_message(message, MAX_MESSAGE_LEN>, );

Parameters

NameType
messageBoundedVec<Field
MAX_MESSAGE_LEN>

to_expanded_metadata

to_expanded_metadata(msg_type, msg_metadata);

Parameters

NameType
msg_typeu64
msg_metadatau64

from_expanded_metadata

from_expanded_metadata(input);

Parameters

NameType
inputField

encode_decode_empty_message

encode_decode_empty_message(msg_type, msg_metadata);

Parameters

NameType
msg_typeu64
msg_metadatau64

encode_decode_short_message

encode_decode_short_message(msg_type, msg_metadata, msg_content, );

Parameters

NameType
msg_typeu64
msg_metadatau64
msg_content[Field; MAX_MESSAGE_CONTENT_LEN / 2]

encode_decode_full_message

encode_decode_full_message(msg_type, msg_metadata, msg_content, );

Parameters

NameType
msg_typeu64
msg_metadatau64
msg_content[Field; MAX_MESSAGE_CONTENT_LEN]

to_expanded_metadata_packing

to_expanded_metadata_packing();

Takes no parameters.

from_expanded_metadata_packing

from_expanded_metadata_packing();

Takes no parameters.

to_from_expanded_metadata

to_from_expanded_metadata(original_msg_type, original_msg_metadata);

Parameters

NameType
original_msg_typeu64
original_msg_metadatau64