Skip to content
solidity
import "solidity-scale-codec/src/Xcm/v5/BodyPart/BodyPartCodec.sol";

BodyPartCodec

Kind: library

Functions

encode(struct BodyPart bodyPart)

solidity
function encode(struct BodyPart bodyPart) internal pure returns (bytes)

Encodes a `BodyPart` struct into bytes.

encodedSizeAt(bytes data, uint256 offset)

solidity
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)

Returns the number of bytes that a `BodyPart` struct would occupy when SCALE-encoded.

decode(bytes data)

solidity
function decode(bytes data) internal pure returns (struct BodyPart, uint256)

Decodes a `BodyPart` struct from bytes starting at the beginning of the data.

decodeAt(bytes data, uint256 offset)

solidity
function decodeAt(bytes data, uint256 offset) internal pure returns (struct BodyPart, uint256)

Decodes a `BodyPart` struct from bytes starting at a given offset.

asMembers(struct BodyPart bodyPart)

solidity
function asMembers(struct BodyPart bodyPart) internal pure returns (struct MembersParams)

Decodes a `Members` body part to extract the member count.

asFraction(struct BodyPart bodyPart)

solidity
function asFraction(struct BodyPart bodyPart) internal pure returns (struct FractionParams)

Decodes a `Fraction` body part to extract the nominator and denominator.

asAtLeastProportion(struct BodyPart bodyPart)

solidity
function asAtLeastProportion(struct BodyPart bodyPart) internal pure returns (struct AtLeastProportionParams)

Decodes a `AtLeastProportion` body part to extract the nominator and denominator.

asMoreThanProportion(struct BodyPart bodyPart)

solidity
function asMoreThanProportion(struct BodyPart bodyPart) internal pure returns (struct MoreThanProportionParams)

Decodes a `MoreThanProportion` body part to extract the nominator and denominator.