proof

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: 392022371031953539c833a4e646ed3a419b560d4ea1d7c087a1ef59bc0cf410 Version: 0.1.3

Index

Constants

View Source
const (
	GIndexStateBlockRoots          = uint64(37)
	GIndexStateNextSyncCommittee   = uint64(55)
	GIndexStateFinalizedRoot       = uint64(105)
	GIndexStateHistoricalSummaries = uint64(118)
)

Variables

This section is empty.

Functions

func ArrayIdxToGIndex

func ArrayIdxToGIndex(base, len, idx, elementSize uint64) uint64

func BlockRootsIdxToGIndex

func BlockRootsIdxToGIndex(idx uint64) uint64

func HistoricalSummariesIdxToGIndex

func HistoricalSummariesIdxToGIndex(idx uint64) uint64

func TreeOffsetProofToNode

func TreeOffsetProofToNode(offsets []uint16, leaves [][]byte) (*ssz.Node, error)

TreeOffsetProofToNode Recreate a `Node` given offsets and leaves of a tree-offset proof See https://github.com/protolambda/eth-merkle-trees/blob/master/tree_offsets.md

func TreeOffsetProofToSSZProof

func TreeOffsetProofToSSZProof(data []byte) (*ssz.Proof, error)

func VerifyBranch added in v0.3.0

func VerifyBranch(index int, leaf []byte, hashes [][]byte, root []byte) (bool, error)

Types

type RootsForHistory

type RootsForHistory struct {
	Roots [][]byte `ssz-size:"8192,32"`
}

func (*RootsForHistory) GetTree

func (r *RootsForHistory) GetTree() (*ssz.Node, error)

GetTree ssz hashes the RootsForHistory object

func (*RootsForHistory) HashTreeRoot

func (r *RootsForHistory) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the RootsForHistory object

func (*RootsForHistory) HashTreeRootWith

func (r *RootsForHistory) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the RootsForHistory object with a hasher

func (*RootsForHistory) MarshalSSZ

func (r *RootsForHistory) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the RootsForHistory object

func (*RootsForHistory) MarshalSSZTo

func (r *RootsForHistory) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the RootsForHistory object to a target array

func (*RootsForHistory) Set

func (r *RootsForHistory) Set(i int, data []byte)

func (*RootsForHistory) SizeSSZ

func (r *RootsForHistory) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the RootsForHistory object

func (*RootsForHistory) UnmarshalSSZ

func (r *RootsForHistory) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the RootsForHistory object

type SingleProof

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

func NewSingleProof

func NewSingleProof(data []byte) (*SingleProof, error)

func (*SingleProof) Leaf

func (s *SingleProof) Leaf() []byte

func (*SingleProof) SSZ

func (s *SingleProof) SSZ() *ssz.Proof

type TreeOffsetProof

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

func NewTreeOffsetProof

func NewTreeOffsetProof(data []byte) (*TreeOffsetProof, error)

func (*TreeOffsetProof) GetGIndex

func (t *TreeOffsetProof) GetGIndex() int

func (*TreeOffsetProof) Leaves

func (t *TreeOffsetProof) Leaves() [][]byte

func (*TreeOffsetProof) Offsets

func (t *TreeOffsetProof) Offsets() []uint16

Jump to

Keyboard shortcuts

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