Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNewPayloadSyncing = errors.New("newPayload status is SYNCING")
ErrNewPayloadSyncing is returned when engine_newPayload returns SYNCING status.
Functions ¶
func IsSyncingError ¶
IsSyncingError checks if the error is a SYNCING status error.
Types ¶
type ComposedValidator ¶
type ComposedValidator struct {
// contains filtered or unexported fields
}
ComposedValidator runs multiple validators in sequence.
func NewComposedValidator ¶
func NewComposedValidator(validators ...Validator) *ComposedValidator
NewComposedValidator creates a validator that runs multiple validators in sequence.
type ErrorValidator ¶
type ErrorValidator struct{}
ErrorValidator fails if the response contains an error field.
type ForkchoiceUpdatedResult ¶
type ForkchoiceUpdatedResult struct {
PayloadStatus PayloadStatus `json:"payloadStatus"`
PayloadID string `json:"payloadId,omitempty"`
}
ForkchoiceUpdatedResult represents the result of an engine_forkchoiceUpdated call.
type ForkchoiceUpdatedValidator ¶
type ForkchoiceUpdatedValidator struct{}
ForkchoiceUpdatedValidator fails if engine_forkchoiceUpdated* responses don't have VALID status.
type NewPayloadResult ¶
type NewPayloadResult struct {
Status string `json:"status"`
LatestValidHash string `json:"latestValidHash,omitempty"`
ValidationError string `json:"validationError,omitempty"`
}
NewPayloadResult represents the result of an engine_newPayload call.
type NewPayloadValidator ¶
type NewPayloadValidator struct{}
NewPayloadValidator fails if engine_newPayload* responses don't have VALID status.
type PayloadStatus ¶
type PayloadStatus struct {
Status string `json:"status"`
LatestValidHash string `json:"latestValidHash,omitempty"`
ValidationError string `json:"validationError,omitempty"`
}
PayloadStatus represents the payload status in forkchoiceUpdated responses.
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Response represents a JSON-RPC 2.0 response.
func (*Response) ParseResult ¶
ParseResult parses the result field into the provided type.
type Validator ¶
Validator validates JSON-RPC responses.
func DefaultValidator ¶
func DefaultValidator() Validator
DefaultValidator returns a composed validator with ErrorValidator, NewPayloadValidator, and ForkchoiceUpdatedValidator.