maps

package
v0.42.9 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFromMap

func HashFromMap(m map[string][]byte) []byte

HashFromMap computes a merkle tree from sorted map and returns the merkle root.

func ProofsFromMap

func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*tmcrypto.Proof, []string)

ProofsFromMap generates proofs from a map. The keys/values of the map will be used as the keys/values in the underlying key-value pairs. The keys are sorted before the proofs are computed.

Types

type KVPair

type KVPair kv.Pair

A local extension to KVPair that can be hashed. Key and value are length prefixed and concatenated, then hashed.

func NewKVPair

func NewKVPair(key, value []byte) KVPair

NewKVPair takes in a key and value and creates a kv.Pair wrapped in the local extension KVPair

func (KVPair) Bytes

func (kv KVPair) Bytes() []byte

Bytes returns key || value, with both the key and value length prefixed.

Jump to

Keyboard shortcuts

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