proof

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFoundInProofTrie = errors.New("key not found in proof trie")
	ErrValueMismatchProofTrie = errors.New("value found in proof trie does not match")
)
View Source
var (
	ErrEmptyProof       = errors.New("proof slice empty")
	ErrRootNodeNotFound = errors.New("root node not found in proof")
)
View Source
var (
	ErrKeyNotFound = errors.New("key not found")
)

Functions

func Generate

func Generate(rootHash []byte, fullKeys [][]byte, database db.DBGetter) (
	encodedProofNodes [][]byte, err error)

Generate generates and deduplicates the encoded proof nodes for the trie corresponding to the root hash given, and for the slice of (Little Endian) full keys given. The database given is used to load the trie using the root hash given.

func Verify

func Verify(encodedProofNodes [][]byte, rootHash, key, value []byte) (err error)

Verify verifies a given key and value belongs to the trie by creating a proof trie based on the encoded proof nodes given. The order of proofs is ignored. A nil error is returned on success. Note this is exported because it is imported and used by: https://github.com/ComposableFi/ibc-go/blob/6d62edaa1a3cb0768c430dab81bb195e0b0c72db/modules/light-clients/11-beefy/types/client_state.go#L78

Types

This section is empty.

Jump to

Keyboard shortcuts

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