arbotree

package module
v0.0.0-...-dd88527 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package arbotree provides the functions for creating and managing an arbo merkletree adapted to the CensusTree interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

type Tree struct {
	Tree *arbo.Tree
	// contains filtered or unexported fields
}

func (*Tree) Add

func (t *Tree) Add(index, value []byte) error

func (*Tree) AddBatch

func (t *Tree) AddBatch(indexes, values [][]byte) ([]int, error)

func (*Tree) CheckProof

func (t *Tree) CheckProof(index, value, root, mproof []byte) (bool, error)

func (*Tree) Dump

func (t *Tree) Dump(root []byte) ([]byte, error)

func (*Tree) DumpPlain

func (t *Tree) DumpPlain(root []byte) ([][]byte, [][]byte, error)

func (*Tree) GenProof

func (t *Tree) GenProof(index, value []byte) ([]byte, error)

func (*Tree) HashExists

func (t *Tree) HashExists(hash []byte) (bool, error)

func (*Tree) ImportDump

func (t *Tree) ImportDump(data []byte) error

func (*Tree) Init

func (t *Tree) Init(name, storageDir string) error

func (*Tree) IsPublic

func (t *Tree) IsPublic() bool

IsPublic returns true if the tree is available

func (*Tree) LastAccess

func (t *Tree) LastAccess() int64

func (*Tree) MaxKeySize

func (t *Tree) MaxKeySize() int

func (*Tree) Publish

func (t *Tree) Publish()

Publish makes a merkle tree available for queries. Application layer should check IsPublish() before considering the Tree available.

func (*Tree) Root

func (t *Tree) Root() []byte

func (*Tree) Size

func (t *Tree) Size(root []byte) (int64, error)

func (*Tree) Snapshot

func (t *Tree) Snapshot(root []byte) (censustree.Tree, error)

func (*Tree) UnPublish

func (t *Tree) UnPublish()

UnPublish makes a merkle tree not available for queries

Jump to

Keyboard shortcuts

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