merkle

package
v0.0.0-...-f318d61 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TreeReceipt []byte

Functions

func NewTree

func NewTree(contents []TreeContent)

Types

type EmptyLeaf

type EmptyLeaf struct {
}

type Hash

type Hash [64]byte

func (Hash) String

func (h Hash) String() string

type Hashable

type Hashable interface {
	// contains filtered or unexported methods
}

type MerkleTrie

type MerkleTrie interface {
	Get(key []byte) ([]byte, bool)
	Put(key []byte, value []byte)
	Del(key []byte, value []byte) bool
}

type Tree

type Tree struct {
	MerkleRoot []byte
	TrunkRoots [][]byte
	TreeHash   []byte
	Branches   map[int]*branch
	Hashable
}

func (*Tree) Build

func (m *Tree) Build(contents []Hashable)

func (*Tree) Del

func (m *Tree) Del(key []byte, value []byte) bool

func (*Tree) Get

func (m *Tree) Get(key []byte) ([]byte, bool)

func (*Tree) Print

func (t *Tree) Print()

func (*Tree) Put

func (m *Tree) Put(key []byte, value []byte)

func (*Tree) Walk

func (t *Tree) Walk() []map[int][]string

type TreeContent

type TreeContent [][]byte

func (TreeContent) Bytes

func (tc TreeContent) Bytes() []byte

type TreeLeaf

type TreeLeaf struct {
	Hashable
	// contains filtered or unexported fields
}

type TreeStates

type TreeStates int
const (
	NONE TreeStates = iota
	WORKING
	DONE
	ERRORED
	IDLE
	VERIFIED
	ARCHIVED
	ARCHIVING
	SNAPSHOT
	WALKING
	HASHING
)

Jump to

Keyboard shortcuts

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