helpers

package
v0.0.0-...-a315113 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package helpers contains functions to build sample data for tests/testgen

In it's own package to avoid poluting the godoc for ics23-iavl

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTree

func BuildTree(size int) (tree *iavl.MutableTree, keys [][]byte, err error)

BuildTree creates random key/values and stores in tree returns a list of all keys in sorted order

func GetKey

func GetKey(allkeys [][]byte, loc tmproofs.Where) []byte

GetKey this returns a key, on Left/Right/Middle

func GetNonKey

func GetNonKey(allkeys [][]byte, loc tmproofs.Where) []byte

GetNonKey returns a missing key - Left of all, Right of all, or in the Middle

Types

type IavlResult

type IavlResult struct {
	Key      []byte
	Value    []byte
	Proof    *iavl.RangeProof
	RootHash []byte
}

IavlResult is the result of one match

func GenerateIavlResult

func GenerateIavlResult(size int, loc tmproofs.Where) (*IavlResult, error)

GenerateIavlResult makes a tree of size and returns a range proof for one random element

returns a range proof and the root hash of the tree

Jump to

Keyboard shortcuts

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