merkle

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forest

type Forest struct {
	// contains filtered or unexported fields
}

func NewForest

func NewForest() (*Forest, primitives.MerkleSha256)

return the merkle trie & the trie root hash for the empty default trie

func (*Forest) GetProof

func (f *Forest) GetProof(rootHash primitives.MerkleSha256, contract string, key string) (Proof, error)

extract and return a verifiable proof for the value of key in the state snapshot reflected by trieId (corresponding to some block height)

func (*Forest) Update

appends diffs starting at requested trie node (hash) and returns new trie node hash NOTE: typical use is baseHash is the newest root hash and return value is new root.

func (*Forest) Verify

func (f *Forest) Verify(rootHash primitives.MerkleSha256, proof Proof, contract string, key string, value string) (bool, error)

return true if proof and merkle rootHash validate value for key. false if it confirms value does not match key return an error if the proof is inconsistent internally, or, with key, value or rootHash

type Node

type Node struct {
	// contains filtered or unexported fields
}

type Proof

type Proof []*Node

Jump to

Keyboard shortcuts

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