merkle

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

type Tree struct {
	Depth int
	// contains filtered or unexported fields
}

Tree represents a merkle tree with specified depth.

func NewMerkleTree

func NewMerkleTree(hashes ...common.Hash) *Tree

NewMerkleTree returns new merkle tree built on hashes.

func (*Tree) Root

func (m *Tree) Root() *TreeNode

Root returns m's root.

type TreeNode

type TreeNode struct {
	Hash   common.Hash
	Parent *TreeNode
	Left   *TreeNode
	Right  *TreeNode
}

TreeNode represents inner node of a merkle tree.

func (*TreeNode) IsLeaf

func (n *TreeNode) IsLeaf() bool

IsLeaf returns true iff n is a leaf.

func (*TreeNode) IsRoot

func (n *TreeNode) IsRoot() bool

IsRoot returns true iff n is a root.

Jump to

Keyboard shortcuts

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