File: src/Xcm/v5/BodyId/BodyIdCodec.sol
BodyIdCodec
Kind: library
ABI Surface
Errors
error InvalidBodyIdLength()error InvalidBodyIdVariant(uint8 variant)
Function Surface
function encode(struct BodyId bodyId) internal pure returns (bytes)- Encodes a
BodyIdinto bytes.
- Encodes a
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)- Returns the number of bytes that a
BodyIdstruct would occupy when SCALE-encoded, starting at a given offset in the data.
- Returns the number of bytes that a
function decode(bytes data) internal pure returns (struct BodyId, uint256)- Decodes a
BodyIdfrom bytes starting at the beginning of the data.
- Decodes a
function decodeAt(bytes data, uint256 offset) internal pure returns (struct BodyId, uint256)- Decodes a
BodyIdfrom bytes starting at a given offset.
- Decodes a
function asMoniker(struct BodyId bodyId) internal pure returns (struct MonikerParams)- Helper function to decode a
BodyIdand extract the moniker name if the type isMoniker.
- Helper function to decode a
function asIndex(struct BodyId bodyId) internal pure returns (struct IndexParams)- Helper function to decode a
BodyIdand extract the index if the type isIndex.
- Helper function to decode a
function \_assertVariant(struct BodyId bodyId, enum BodyIdVariant expected) internal pure