pathfinder

package
v0.24.6-stream-timeout Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: AGPL-3.0 Imports: 4 Imported by: 14

Documentation

Overview

Package pathfinder computes the trie storage path for any given key/value pair

Index

Constants

View Source
const PathByteSize = 32

PathByteSize captures number of bytes each path takes

Variables

This section is empty.

Functions

func KeyToPath

func KeyToPath(key ledger.Key, version uint8) (ledger.Path, error)

KeyToPath converts key into a path version zero applies sha2-256 on value of the key parts (in order ignoring types)

func KeysToPaths

func KeysToPaths(keys []ledger.Key, version uint8) ([]ledger.Path, error)

KeysToPaths converts an slice of keys into a paths

func PathsFromPayloads added in v0.12.0

func PathsFromPayloads(payloads []ledger.Payload, version uint8) ([]ledger.Path, error)

PathsFromPayloads constructs paths from an slice of payload

func PayloadsToValues

func PayloadsToValues(payloads []*ledger.Payload) ([]ledger.Value, error)

PayloadsToValues extracts values from an slice of payload

func QueryToTrieRead

func QueryToTrieRead(q *ledger.Query, version uint8) (*ledger.TrieRead, error)

QueryToTrieRead converts a ledger query into a trie read

func UpdateToPayloads

func UpdateToPayloads(update *ledger.Update) ([]*ledger.Payload, error)

UpdateToPayloads constructs an slice of payloads given ledger update

func UpdateToTrieUpdate

func UpdateToTrieUpdate(u *ledger.Update, version uint8) (*ledger.TrieUpdate, error)

UpdateToTrieUpdate converts an update into a trie update

Types

This section is empty.

Jump to

Keyboard shortcuts

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