StateDB proof/verify is not working
Closed this issue · 0 comments
shuse2 commented
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