witness

package
v0.4.1-beta.r2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRoot

func GenRoot(pg *PathGen) merkle.Leaf

func GenRoots

func GenRoots(pg *PathGen) (roots [merkle.DEPTH + 1]merkle.Leaf)

func NextPathGen

func NextPathGen(pc *IndexCur, pg *PathGen, roots *[merkle.DEPTH + 1]merkle.Leaf)

func ParseIndex

func ParseIndex(pc *IndexCur, index uint64) uint64

func PartialPath

func PartialPath(w Witness) *merkle.PathFiller

Types

type IndexCur

type IndexCur struct {
	Left  uint64
	Count uint64
}

func NewIndexCur

func NewIndexCur(gen *PathGen) (ret IndexCur)

type PathGen

type PathGen struct {
	Root   merkle.Leaf
	Anchor merkle.Leaf
	Leaf   merkle.Leaf
	Path   [merkle.DEPTH]merkle.Leaf
	Index  uint64
}

func NewPathGen

func NewPathGen(tr *merkle.Tree) (pg PathGen)

func NewPathGenAndRoots

func NewPathGenAndRoots(tr *merkle.Tree) (pg PathGen, roots [merkle.DEPTH + 1]merkle.Leaf)

func (*PathGen) Clone

func (p *PathGen) Clone() (ret PathGen)

func (*PathGen) IsComplete

func (pg *PathGen) IsComplete() bool

func (PathGen) ToRef

func (p PathGen) ToRef() *PathGen

type Witness

type Witness struct {
	Tree merkle.Tree
	WitnessBase
}

func (*Witness) Append

func (w *Witness) Append(leaf merkle.Leaf)

func (*Witness) Clone

func (w *Witness) Clone() (ret Witness)

func (*Witness) Element

func (w *Witness) Element() merkle.Leaf

func (*Witness) IsComplete

func (w *Witness) IsComplete() bool

func (*Witness) Path

func (w *Witness) Path() (path []merkle.Leaf, index uint64)

func (*Witness) Root

func (w *Witness) Root() merkle.Leaf

type WitnessBase

type WitnessBase struct {
	Filled       []merkle.Leaf
	Cursor       *merkle.Tree `rlp:"nil"`
	Cursor_depth uint
	Parents      []merkle.Leaf
	Logs         []merkle.Leaf
	Rt           *merkle.Leaf
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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