partial

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: AGPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const PathFinderVersion = 0

PathFinderVersion captures the version of path finder that the partial ledger uses

Variables

This section is empty.

Functions

This section is empty.

Types

type Ledger

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

Ledger implements the ledger functionality for a limited subset of keys (partial ledger). Partial ledgers are designed to be constructed and verified by a collection of proofs from a complete ledger. The partial ledger uses a partial binary Merkle trie which holds intermediate hash value for the pruned branched and prevents updates to keys that were not part of proofs.

func NewLedger

func NewLedger(proof ledger.Proof, s ledger.State) (*Ledger, error)

NewLedger creates a new in-memory trie-backed ledger storage with persistence.

func (*Ledger) Done

func (l *Ledger) Done() <-chan struct{}

Done implements interface module.ReadyDoneAware

func (*Ledger) Get

func (l *Ledger) Get(query *ledger.Query) (values []ledger.Value, err error)

Get read the values of the given keys at the given state it returns the values in the same order as given registerIDs and errors (if any)

func (*Ledger) InitState

func (l *Ledger) InitState() ledger.State

InitState returns the initial state of the ledger

func (*Ledger) Prove

func (l *Ledger) Prove(query *ledger.Query) (proof ledger.Proof, err error)

Prove provides proofs for a ledger query and errors (if any) TODO implement this by iterating over initial proofs to find the ones for the query

func (*Ledger) Ready

func (l *Ledger) Ready() <-chan struct{}

Ready implements interface module.ReadyDoneAware

func (*Ledger) Set

func (l *Ledger) Set(update *ledger.Update) (newState ledger.State, err error)

Set updates the ledger given an update it returns the state after update and errors (if any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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