trie

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RADIX = 256

RADIX specifies the number of unique digits in patricia

Variables

View Source
var (
	// ErrInvalidPatricia indicates invalid operation
	ErrInvalidPatricia = errors.New("invalid patricia operation")

	// ErrPathDiverge indicates the path diverges
	ErrPathDiverge = errors.New("path diverges")
)
View Source
var (

	// ErrInvalidTrie indicates something wrong causing invalid operation
	ErrInvalidTrie = errors.New("invalid trie operation")

	// ErrNotExist indicates entry does not exist
	ErrNotExist = errors.New("not exist in trie")
)

Functions

This section is empty.

Types

type Trie

type Trie interface {
	Upsert([]byte, []byte) error     // insert a new entry
	Get([]byte) ([]byte, error)      // retrieve an existing entry
	Delete([]byte) error             // delete an entry
	Commit([][]byte, [][]byte) error // commit the state changes in a batch
	Close() error                    // close the trie DB
	RootHash() common.Hash32B        // returns trie's root hash
}

Trie is the interface of Merkle Patricia Trie

func NewTrie

func NewTrie(path string, inMem bool) (Trie, error)

NewTrie creates a trie with DB filename

Jump to

Keyboard shortcuts

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