Module codec

Module codec 

Source
Expand description

Encoding and decoding of messages of the protocols used by Polkadot/Substrate.

Re-exports§

pub use crate::finality::decode::CommitMessageRef;
pub use crate::finality::decode::UnsignedPrecommitRef;

Structs§

BlockAnnounceRef
Decoded block announcement notification.
BlockAnnouncesHandshakeDecodeError
Error potentially returned by decode_block_announces_handshake.
BlockAnnouncesHandshakeRef
Decoded handshake sent or received when opening a block announces notifications substream.
BlockData
Block sent in a block response.
BlocksRequestConfig
Description of a block request that can be sent to a peer.
BlocksRequestFields
Which fields should be present in the response.
CallProofRequestConfig
Description of a call proof request that can be sent to a peer.
CatchUpRef
CatchUpRequest
DecodeBlockAnnounceError
Error potentially returned by decode_block_announces_handshake.
DecodeGrandpaNotificationError
Error potentially returned by decode_grandpa_notification.
DecodeGrandpaWarpSyncResponseError
Error potentially returned by decode_grandpa_warp_sync_response.
GrandpaWarpSyncResponse
Response to a GrandPa warp sync request.
GrandpaWarpSyncResponseFragment
Response to a GrandPa warp sync request.
IdentifyResponse
Description of a response to an identify request.
Justification
See BlockData::justifications.
NeighborPacket
PrevoteRef
PrimaryProposeRef
ProtobufDecodeError
Error while decoding the Protobuf encoding.
StateRequest
Description of a state request that can be sent to a peer.
StorageProofRequestConfig
Description of a storage proof request that can be sent to a peer.
UnsignedPrevoteRef
VoteMessageRef

Enums§

BlocksRequestConfigStart
Which block the remote must return first.
BlocksRequestDirection
Whether the first block should be the one with the highest number, of the one with the lowest number.
DecodeBlockRequestError
Error potentially returned by decode_block_request.
DecodeBlockResponseError
Error potentially returned by decode_block_response.
DecodeFindNodeResponseError
Error potentially returned by decode_find_node_response.
DecodeIdentifyResponseError
Error potentially returned by decode_identify_response.
DecodeStateResponseError
Error potentially returned by decode_state_response.
DecodeStorageCallProofResponseError
Error potentially returned by decode_storage_or_call_proof_response.
GrandpaNotificationRef
MessageRef
ProtocolName
Name of a protocol that is part of the Substrate/Polkadot networking.
Role
Role a node reports playing on the network.
StateRequestStart
See StateRequest::start_key.
StorageOrCallProof
Passed as parameter to decode_storage_or_call_proof_response to indicate what kind of request the response corresponds to.

Functions§

build_block_request
Builds the bytes corresponding to a block request.
build_block_response
Builds the bytes corresponding to a block response.
build_call_proof_request
Builds the bytes corresponding to a call proof request.
build_find_node_request
Builds a wire message to send on the Kademlia request-response protocol to ask the target to return the nodes closest to the parameter.
build_identify_response
Builds the bytes corresponding to a block request.
build_state_request
Builds the bytes corresponding to a state request.
build_storage_proof_request
Builds the bytes corresponding to a storage proof request.
decode_block_announce
Decodes a block announcement.
decode_block_announces_handshake
Decodes a SCALE-encoded block announces handshake.
decode_block_request
Decodes a blocks request.
decode_block_response
Decodes a response to a block request.
decode_find_node_response
Decodes a response to a request built using build_find_node_request.
decode_grandpa_notification
Attempt to decode the given SCALE-encoded Grandpa notification.
decode_grandpa_warp_sync_response
Decodes a SCALE-encoded GrandPa warp sync response.
decode_identify_response
Decodes a response to an identify request.
decode_protocol_name
Decodes a protocol name into its components.
decode_state_response
Decodes a response to a state request.
decode_storage_or_call_proof_response
Decodes a response to a storage proof request or a call proof request.
encode_block_announce
Turns a block announcement into its SCALE-encoding ready to be sent over the wire.
encode_block_announces_handshake
Turns a block announces handshake into its SCALE-encoding ready to be sent over the wire.
encode_protocol_name
Turns a ProtocolName into its string version. Returns a list of objects that, when concatenated together, forms the string version of the ProtocolName.
encode_protocol_name_string
Turns a ProtocolName into a string.