backend

package
v0.0.0-...-acb1236 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ByteChunkSize = 32
View Source
const ChunkSize = 32

ChunkSize is used to check if packed bytes align to the chunk sized used by the merkleization algorithm. If not, the bytes should be zero-padded to the nearest multiple of ChunkSize.

Variables

This section is empty.

Functions

func GenerateHashTreeRoot

func GenerateHashTreeRoot(g *generateContainer) (*generatedCode, error)

func GenerateMarshalSSZ

func GenerateMarshalSSZ(g *generateContainer) (*generatedCode, error)

func GenerateSizeSSZ

func GenerateSizeSSZ(g *generateContainer) (*generatedCode, error)

func GenerateUnmarshalSSZ

func GenerateUnmarshalSSZ(g *generateContainer) (*generatedCode, error)

func RenderedPackageName

func RenderedPackageName(n string) string

RenderedPackageName reduces the fully qualified package name to the relative package name, ie github.com/prysmaticlabs/prysm/v3/proto/eth/v1 -> v1

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator needs to be initialized with the package name, so use the new NewGenerator func for proper setup.

func NewGenerator

func NewGenerator(packagePath string) *Generator

func (*Generator) Generate

func (g *Generator) Generate(vr gentypes.ValRep) error

TODO Generate should be able to return an error

func (*Generator) Render

func (g *Generator) Render() ([]byte, error)

type ImportNamer

type ImportNamer struct {
	// contains filtered or unexported fields
}

func NewImportNamer

func NewImportNamer(source string, defaults map[string]string) *ImportNamer

func (*ImportNamer) ImportPairs

func (n *ImportNamer) ImportPairs() string

func (*ImportNamer) ImportSource

func (n *ImportNamer) ImportSource() string

func (*ImportNamer) Name

func (n *ImportNamer) Name(p *types.Package) string

func (*ImportNamer) NameString

func (n *ImportNamer) NameString(p string) string

Jump to

Keyboard shortcuts

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