Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Verify Proof fails if there is an extension with an embedded branch #52

Closed
no2chem opened this issue Aug 21, 2018 · 0 comments · Fixed by #51
Closed

Verify Proof fails if there is an extension with an embedded branch #52

no2chem opened this issue Aug 21, 2018 · 0 comments · Fixed by #51

Comments

@no2chem
Copy link
Contributor

no2chem commented Aug 21, 2018

This can occur if you insert lots of small key/values into the tree.

A simple example of this bug is below:

const Tree = require('merkle-patricia-tree');
const tree = new Tree();
tree.put('a', 'a', (err) => {
    tree.put('b', 'b', (err) => {
         Tree.prove(tree, 'a', (err, proof) => {
            Tree.verifyProof(tree.root, 'a', proof, (err, val) => {
                // err = "Error: Unexpected end of proof"
                // expected : val === 'a' 
            }
        } 
    }
}

PR #51 fixes this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant