File: src/Xcm/v5/BodyPart/BodyPartCodec.sol
BodyPartCodec
Kind: library
ABI Surface
Errors
error InvalidBodyPartLength()error InvalidBodyPartVariant(uint8 variant)
Function Surface
function encode(struct BodyPart bodyPart) internal pure returns (bytes)- Encodes a
BodyPartstruct into bytes.
- Encodes a
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)- Returns the number of bytes that a
BodyPartstruct would occupy when SCALE-encoded.
- Returns the number of bytes that a
function decode(bytes data) internal pure returns (struct BodyPart, uint256)- Decodes a
BodyPartstruct from bytes starting at the beginning of the data.
- Decodes a
function decodeAt(bytes data, uint256 offset) internal pure returns (struct BodyPart, uint256)- Decodes a
BodyPartstruct from bytes starting at a given offset.
- Decodes a
function asMembers(struct BodyPart bodyPart) internal pure returns (struct MembersParams)- Decodes a
Membersbody part to extract the member count.
- Decodes a
function asFraction(struct BodyPart bodyPart) internal pure returns (struct FractionParams)- Decodes a
Fractionbody part to extract the nominator and denominator.
- Decodes a
function asAtLeastProportion(struct BodyPart bodyPart) internal pure returns (struct AtLeastProportionParams)- Decodes a
AtLeastProportionbody part to extract the nominator and denominator.
- Decodes a
function asMoreThanProportion(struct BodyPart bodyPart) internal pure returns (struct MoreThanProportionParams)- Decodes a
MoreThanProportionbody part to extract the nominator and denominator.
- Decodes a
function \_asProportion(struct BodyPart bodyPart) private pure returns (uint32, uint32)- Decodes a
Fraction,AtLeastProportion, orMoreThanProportionbody part to extract the nominator and denominator.
- Decodes a
function \_assertVariant(struct BodyPart bodyPart, enum BodyPartVariant expected) internal pure