File: src/Xcm/v5/NetworkId/NetworkIdCodec.sol
NetworkIdCodec
Kind: library
ABI Surface
Errors
error InvalidNetworkIdLength()error InvalidNetworkIdVariant(uint8 variant)
Function Surface
function encode(struct NetworkId networkId) internal pure returns (bytes)- Encodes a
NetworkIdstruct into SCALE format.
- Encodes a
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)- Returns the number of bytes that a
NetworkIdstruct would occupy when SCALE-encoded.
- Returns the number of bytes that a
function decode(bytes data) internal pure returns (struct NetworkId, uint256)- Decodes a byte array into a
NetworkIdstruct.
- Decodes a byte array into a
function decodeAt(bytes data, uint256 offset) internal pure returns (struct NetworkId, uint256)- Decodes a byte array into a
NetworkIdstruct.
- Decodes a byte array into a
function asByGenesis(struct NetworkId networkId) internal pure returns (struct ByGenesisParams)- Decodes a
ByGenesisnetwork ID, returning the genesis hash.
- Decodes a
function asEthereum(struct NetworkId networkId) internal pure returns (struct EthereumParams)- Decodes a
Ethereumnetwork ID, returning the chain ID.
- Decodes a
function asFork(struct NetworkId networkId) internal pure returns (struct ByForkParams)- Decodes a
ByForknetwork ID, returning the block number and block hash of the fork point.
- Decodes a
function \_assertVariant(struct NetworkId networkId, enum NetworkIdVariant expected) private pure