forest

package
v0.29.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forest

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

Forest is a representation of multiple tries mapped by their state commitment hash.

func New

func New() *Forest

New returns a new empty forest.

func (*Forest) Has

func (f *Forest) Has(commit flow.StateCommitment) bool

Has returns whether a state commitment matches one of the trees within the forest.

func (*Forest) Parent

func (f *Forest) Parent(commit flow.StateCommitment) (flow.StateCommitment, bool)

Parent returns the parent of the given state commitment.

func (*Forest) Paths

func (f *Forest) Paths(commit flow.StateCommitment) ([]ledger.Path, bool)

Paths returns the matching tree's paths for the given state commitment.

func (*Forest) Reset

func (f *Forest) Reset(finalized flow.StateCommitment)

Reset deletes all tries that do not match the given state commitment.

func (*Forest) Save

func (f *Forest) Save(tree *trie.MTrie, paths []ledger.Path, parent flow.StateCommitment)

Save adds a tree to the forest.

func (*Forest) Tree

func (f *Forest) Tree(commit flow.StateCommitment) (*trie.MTrie, bool)

Tree returns the matching tree for the given state commitment.

Jump to

Keyboard shortcuts

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