partial

package
v0.28.16-resource-mgr-... Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultPathFinderVersion = 1

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, pathFinderVer uint8) (*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) GetSingleValue added in v0.26.2

func (l *Ledger) GetSingleValue(query *ledger.QuerySingleValue) (value ledger.Value, err error)

GetSingleValue reads value of a given key at the given state

func (*Ledger) HasState added in v0.26.16

func (l *Ledger) HasState(other ledger.State) bool

HasState returns true if the given state exists inside the ledger

func (*Ledger) InitialState added in v0.10.0

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

InitialState 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, trieUpdate *ledger.TrieUpdate, 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