Update README.md

fix example of bad proof
This commit is contained in:
daniel 2022-10-21 13:52:39 +03:00 committed by GitHub
parent 1ae0d607bf
commit f60ed66351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -71,8 +71,8 @@ console.log(tree.verify(proof, leaf, root)) // true
const badLeaves = ['a', 'x', 'c'].map(x => SHA256(x))
const badTree = new MerkleTree(badLeaves, SHA256)
const badLeaf = SHA256('x')
const badProof = tree.getProof(badLeaf)
console.log(tree.verify(badProof, leaf, root)) // false
const badProof = badTree.getProof(badLeaf)
console.log(badTree.verify(badProof, badLeaf, root)) // false
```
Print tree to console: