Documentation ¶
Index ¶
- Constants
- func InterfaceFromMessageCode(code uint8) (interface{}, string, error)
- func IsErrInvalidEncoding(err error) bool
- func IsErrMsgUnmarshal(err error) bool
- func IsErrUnknownMsgCode(err error) bool
- func MessageCodeFromInterface(v interface{}) (uint8, string, error)
- type ErrInvalidEncoding
- type ErrMsgUnmarshal
- type ErrUnknownMsgCode
Constants ¶
const ( CodeMin uint8 = iota + 1 // consensus CodeBlockProposal CodeBlockVote // protocol state sync CodeSyncRequest CodeSyncResponse CodeRangeRequest CodeBatchRequest CodeBlockResponse // cluster consensus CodeClusterBlockProposal CodeClusterBlockVote CodeClusterBlockResponse // collections, guarantees & transactions CodeCollectionGuarantee CodeTransaction CodeTransactionBody // core messages for execution & verification CodeExecutionReceipt CodeResultApproval // execution state synchronization CodeExecutionStateSyncRequest CodeExecutionStateDelta // data exchange for execution of blocks CodeChunkDataRequest CodeChunkDataResponse // result approvals CodeApprovalRequest CodeApprovalResponse // generic entity exchange engines CodeEntityRequest CodeEntityResponse // testing CodeEcho // DKG CodeDKGMessage CodeMax )
Variables ¶
This section is empty.
Functions ¶
func InterfaceFromMessageCode ¶
InterfaceFromMessageCode returns an interface with the correct underlying go type of the message code represents. Expected error returns during normal operations:
- ErrUnknownMsgCode if message code does not match any of the configured message codes above.
func IsErrInvalidEncoding ¶
IsErrInvalidEncoding returns true if an error is ErrInvalidEncoding
func IsErrMsgUnmarshal ¶
IsErrMsgUnmarshal returns true if an error is ErrMsgUnmarshal
func IsErrUnknownMsgCode ¶
IsErrUnknownMsgCode returns true if an error is ErrUnknownMsgCode
func MessageCodeFromInterface ¶
MessageCodeFromInterface returns the correct Code based on the underlying type of message v.
Types ¶
type ErrInvalidEncoding ¶
type ErrInvalidEncoding struct {
// contains filtered or unexported fields
}
ErrInvalidEncoding indicates that the message code byte (first byte of message payload) is unknown.
func NewInvalidEncodingErr ¶
func NewInvalidEncodingErr(err error) ErrInvalidEncoding
NewInvalidEncodingErr returns a new ErrInvalidEncoding
func (ErrInvalidEncoding) Error ¶
func (e ErrInvalidEncoding) Error() string
type ErrMsgUnmarshal ¶
type ErrMsgUnmarshal struct {
// contains filtered or unexported fields
}
ErrMsgUnmarshal indicates that the message could not be unmarshalled.
func NewMsgUnmarshalErr ¶
func NewMsgUnmarshalErr(code uint8, msgType string, err error) ErrMsgUnmarshal
NewMsgUnmarshalErr returns a new ErrMsgUnmarshal
func (ErrMsgUnmarshal) Error ¶
func (e ErrMsgUnmarshal) Error() string
type ErrUnknownMsgCode ¶
type ErrUnknownMsgCode struct {
// contains filtered or unexported fields
}
ErrUnknownMsgCode indicates that the message code byte (first byte of message payload) is unknown.
func NewUnknownMsgCodeErr ¶
func NewUnknownMsgCodeErr(code uint8) ErrUnknownMsgCode
NewUnknownMsgCodeErr returns a new ErrUnknownMsgCode
func (ErrUnknownMsgCode) Error ¶
func (e ErrUnknownMsgCode) Error() string