Skip to content

Commit

Permalink
doc: Add godoc to VerifyMembership regarding path (cosmos#1742)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
renaynay and Carlos Rodriguez authored Aug 8, 2022
1 parent e5ec801 commit 09e4adc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/core/23-commitment/types/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func ApplyPrefix(prefix exported.Prefix, path MerklePath) (MerklePath, error) {
var _ exported.Proof = (*MerkleProof)(nil)

// VerifyMembership verifies the membership of a merkle proof against the given root, path, and value.
// Note that the path is expected as []string{<store key of module>, <key corresponding to requested value>}.
func (proof MerkleProof) VerifyMembership(specs []*ics23.ProofSpec, root exported.Root, path exported.Path, value []byte) error {
if err := proof.validateVerificationArgs(specs, root); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion modules/core/exported/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Path interface {
// Proof implements spec:CommitmentProof.
// Proof can prove whether the key-value pair is a part of the Root or not.
// Each proof has designated key-value pair it is able to prove.
// Proofs includes key but value is provided dynamically at the verification time.
// Proofs include key but value is provided dynamically at the verification time.
type Proof interface {
VerifyMembership([]*ics23.ProofSpec, Root, Path, []byte) error
VerifyNonMembership([]*ics23.ProofSpec, Root, Path) error
Expand Down

0 comments on commit 09e4adc

Please sign in to comment.