merkletree_proof

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: AGPL-3.0 Imports: 10 Imported by: 1

README

merkletree-proof

Merkletree proof generation/validation based on reverse hash service

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeNotFound = errors.New("node not found")

Functions

This section is empty.

Types

type HTTPReverseHashCli

type HTTPReverseHashCli struct {
	URL         string
	HTTPTimeout time.Duration
}

func (*HTTPReverseHashCli) GenerateProof

func (cli *HTTPReverseHashCli) GenerateProof(ctx context.Context,
	treeRoot *merkletree.Hash,
	key *merkletree.Hash) (*merkletree.Proof, error)

GenerateProof generates proof of existence or in-existence of a key in a tree identified by a treeRoot.

func (*HTTPReverseHashCli) GetNode

func (cli *HTTPReverseHashCli) GetNode(ctx context.Context,
	hash *merkletree.Hash) (Node, error)

func (*HTTPReverseHashCli) SaveNodes

func (cli *HTTPReverseHashCli) SaveNodes(ctx context.Context,
	nodes []Node) error

type Node

type Node struct {
	Hash     *merkletree.Hash
	Children []*merkletree.Hash
}

func (Node) MarshalJSON

func (n Node) MarshalJSON() ([]byte, error)

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(in []byte) error

type NodeType

type NodeType byte
const (
	NodeTypeUnknown NodeType = iota
	NodeTypeMiddle  NodeType = iota
	NodeTypeLeaf    NodeType = iota
	NodeTypeState   NodeType = iota
)

Directories

Path Synopsis
tests
integration Module

Jump to

Keyboard shortcuts

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