Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

StateDB proof/verify is not working #65

Closed
shuse2 opened this issue Oct 5, 2022 · 0 comments · Fixed by #68
Closed

StateDB proof/verify is not working #65

shuse2 opened this issue Oct 5, 2022 · 0 comments · Fixed by #68
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Oct 5, 2022

Expected behavior

StateDB.verify and StateDB.proof should be the same interface as SparseMerkleTree.verify and SparseMerkleTree.proof.

Unit test on JS should be added to ensure the interface is correct. Note that StateDB key is by default.

Actual behavior

The internal smt.verify and smt.proof is used for both in memory and state db, but bridge between js and rust is not working.

Steps to reproduce

describe('proof', () => {
            it('should generate proof and verify the result', async () => {
                const queries = [getRandomBytes(38), getRandomBytes(38)];
                const proof = await db.proof(root, queries);

                const result = await db.verify(root, queries, proof);

                expect(result).toEqual(false);
            });
        });

above unit test should pass in the state_db.spec.js

@matjazv matjazv self-assigned this Oct 6, 2022
@shuse2 shuse2 added this to the Sprint 10 milestone Oct 10, 2022
shuse2 added a commit that referenced this issue Oct 13, 2022
Fix prove/verify interface between JS and Rust - Closes #65
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants