Version: v1.4.4 Latest Latest

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

Go to latest
Published: Aug 31, 2021 License: GPL-3.0 Imports: 8 Imported by: 0




This section is empty.


View Source
var ErrNilInnerState = errors.New("nil inner state")

ErrNilInnerState returns when the inner state is nil and no copy set or get operations can be performed on state.


This section is empty.


type BeaconState

type BeaconState struct {
	// contains filtered or unexported fields

BeaconState defines a struct containing utilities for the eth2 chain state, defining getters and setters for its respective values and helpful functions such as HashTreeRoot().

type FieldTrie

type FieldTrie struct {
	// contains filtered or unexported fields

FieldTrie is the representation of the representative trie of the particular field.

func NewFieldTrie

func NewFieldTrie(field fieldIndex, elements interface{}, length uint64) (*FieldTrie, error)

NewFieldTrie is the constructor for the field trie data structure. It creates the corresponding trie according to the given parameters. Depending on whether the field is a basic/composite array which is either fixed/variable length, it will appropriately determine the trie.

func (*FieldTrie) CopyTrie

func (f *FieldTrie) CopyTrie() *FieldTrie

CopyTrie copies the references to the elements the trie is built on.

func (*FieldTrie) RecomputeTrie

func (f *FieldTrie) RecomputeTrie(indices []uint64, elements interface{}) ([32]byte, error)

RecomputeTrie rebuilds the affected branches in the trie according to the provided changed indices and elements. This recomputes the trie according to the particular field the trie is based on.

func (*FieldTrie) TrieRoot

func (f *FieldTrie) TrieRoot() ([32]byte, error)

TrieRoot returns the corresponding root of the trie.

Jump to

Keyboard shortcuts

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