Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMembershipProof ¶
func CreateMembershipProof(tree *smt.SparseMerkleTree, key []byte) (*ics23.CommitmentProof, error)
CreateMembershipProof will produce a CommitmentProof that the given key (and queries value) exists in the SMT. If the key doesn't exist in the tree, this will return an error.
func CreateNonMembershipProof ¶
func CreateNonMembershipProof(tree *smt.SparseMerkleTree, key []byte, preimages PreimageMap) (*ics23.CommitmentProof, error)
CreateNonMembershipProof will produce a CommitmentProof that the given key doesn't exist in the SMT. If the key exists in the tree, this will return an error.
Types ¶
type PreimageMap ¶
type PreimageMap interface { // KeyFor returns the preimage (key) for given path index. KeyFor(int) []byte // FindPath returns the ordered index of a given path, and whether it's contained in the tree. // If not found, the returned index is where the path would be inserted. FindPath([32]byte) (int, bool) // Len returns the number of mapped paths. Len() int }
PreimageMap represents an interface for accessing hashed tree paths and retrieving their corresponding preimages.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package helpers contains functions to build sample data for tests/testgen
|
Package helpers contains functions to build sample data for tests/testgen |
Click to show internal directories.
Click to hide internal directories.