Documentation ¶
Overview ¶
Package helpers contains functions to build sample data for tests/testgen
In it's own package to avoid polluting the godoc for ics23-smt
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PreimageMap ¶
type PreimageMap struct {
// contains filtered or unexported fields
}
PreimageMap maps each tree path back to its preimage needed because SparseMerkleTree methods take preimage as arg and hash internally
func BuildTree ¶
func BuildTree(size int) (*smt.SparseMerkleTree, *PreimageMap, error)
BuildTree creates random key/values and stores in tree returns a list of all keys in sorted order
func (PreimageMap) FindPath ¶
func (pim PreimageMap) FindPath(path [32]byte) (int, bool)
FindPath returns the closest index to path in paths, and whether it's a match. If not found, the returned index is where the path would be.
func (PreimageMap) GetKey ¶
func (pim PreimageMap) GetKey(loc tmproofs.Where) []byte
GetKey this returns a key, on Left/Right/Middle
func (PreimageMap) GetNonKey ¶
func (pim PreimageMap) GetNonKey(loc tmproofs.Where) []byte
GetNonKey returns a missing key - Left of all, Right of all, or in the Middle
func (PreimageMap) KeyFor ¶
func (pim PreimageMap) KeyFor(pathIx int) []byte
KeyFor returns the preimage (key) for given path index.