utils

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTransaction = errors.New("invalid transaction")
	ErrLength             = errors.New("invalid length")
	ErrNilPayload         = errors.New("nil payload")
	ErrUnsupportedVersion = errors.New("unsupported version")
	ErrUnknownVersion     = errors.New("unknown version")
	ErrInvalidPubkey      = errors.New("invalid pubkey")
	ErrInvalidSignature   = errors.New("invalid signature")
)

Functions

func BlsPublicKeyToPublicKey

func BlsPublicKeyToPublicKey(blsPubKey *bls.PublicKey) (ret phase0.BLSPubKey, err error)

func BlsSignatureToSignature

func BlsSignatureToSignature(blsSignature *bls.Signature) (ret phase0.BLSSignature, err error)

func ComputeBlockHash added in v1.7.1

func ComputeBlockHash(payload *api.VersionedExecutionPayload, parentBeaconRoot *phase0.Root) (phase0.Hash32, error)

ComputeBlockHash computes the block hash for a given execution payload.

func DecodeJSON

func DecodeJSON(r io.Reader, dst any) error

DecodeJSON decodes a JSON string into a struct while disallowing unknown fields

func HexToAddress

func HexToAddress(s string) (ret bellatrix.ExecutionAddress, err error)

HexToAddress takes a hex string and returns an Address

func HexToHash

func HexToHash(s string) (ret phase0.Hash32, err error)

HexToHash takes a hex string and returns a Hash

func HexToPubkey

func HexToPubkey(s string) (ret phase0.BLSPubKey, err error)

HexToPubkey takes a hex string and returns a PublicKey

func HexToSignature

func HexToSignature(s string) (ret phase0.BLSSignature, err error)

HexToSignature takes a hex string and returns a Signature

func PayloadToPayloadHeader added in v1.7.1

func PayloadToPayloadHeader(payload *api.VersionedExecutionPayload) (*api.VersionedExecutionPayloadHeader, error)

PayloadToPayloadHeader converts an ExecutionPayload to ExecutionPayloadHeader

Types

This section is empty.

Jump to

Keyboard shortcuts

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