shared

package
v5.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexFromQuery

func HexFromQuery(w http.ResponseWriter, r *http.Request, name string, length int, required bool) (string, []byte, bool)

func HexFromRoute

func HexFromRoute(w http.ResponseWriter, r *http.Request, name string, length int) (string, []byte, bool)

func IsOptimistic

func IsOptimistic(
	ctx context.Context,
	w http.ResponseWriter,
	optimisticModeFetcher blockchain.OptimisticModeFetcher,
) (bool, error)

IsOptimistic checks whether the beacon node is currently optimistic and writes it to the response.

func IsSyncing

func IsSyncing(
	ctx context.Context,
	w http.ResponseWriter,
	syncChecker sync.Checker,
	headFetcher blockchain.HeadFetcher,
	timeFetcher blockchain.TimeFetcher,
	optimisticModeFetcher blockchain.OptimisticModeFetcher,
) bool

IsSyncing checks whether the beacon node is currently syncing and writes out the sync status.

func UintFromQuery

func UintFromQuery(w http.ResponseWriter, r *http.Request, name string, required bool) (string, uint64, bool)

func UintFromRoute

func UintFromRoute(w http.ResponseWriter, r *http.Request, name string) (string, uint64, bool)

func ValidateHex

func ValidateHex(w http.ResponseWriter, name, s string, length int) ([]byte, bool)

func ValidateUint

func ValidateUint(w http.ResponseWriter, name, s string) (uint64, bool)

func WriteBlockFetchError

func WriteBlockFetchError(w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock, err error) bool

WriteBlockFetchError writes an appropriate error based on the supplied argument. The argument error should be a result of fetching block.

func WriteStateFetchError

func WriteStateFetchError(w http.ResponseWriter, err error)

WriteStateFetchError writes an appropriate error based on the supplied argument. The argument error should be a result of fetching state.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL