LiskArchive/lisk-db

Improve `verify` interface

Closed this issue · 0 comments

shuse2 commented

Description

Improve SMT verify interface to be clear whether inclusion or non-inclusion proof is verified, we should add

  • verifyInclusionProof(root: Buffer, queries: Buffer[], proof: Proof): Promise
  • verifyNonInclusionProof(root: Buffer, queries: Buffer[], proof: Proof): Promise

to both StateDB and SparseMerkleTree.

Along with the implementation, the type definition also should be updated

Motivation

  • Current verify method requires user of the function to check if it's inclusion proof or non-inclusion proof