-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insert after delete #44
Conversation
tests/full.test.ts
Outdated
await mt.add(7n, 7n); | ||
}); | ||
|
||
it('test insert delete node right fork', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"right branch"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I renamed all unit tests. From fork to branch
tests/full.test.ts
Outdated
await mt.add(7n, 7n); | ||
|
||
const existProof = await mt.generateProof(7n); | ||
expect(existProof.proof.existence).to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to check the proof siblings here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for all new unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can check something like this as well?
add(1,1)
add(7,1)
add(15,1)
delete(15)
check the proof of 7: existence = true, siblings == expected siblings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a unit test for 3, 7, 15. It will be equally deep. Don't see any reason for this unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit different. When you remove 7 or 15 the sibling leaf will move only one level up but not 2 levels up as in case with 1,7,15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I added the same test for left branch
tests/full.test.ts
Outdated
@@ -702,6 +702,85 @@ for (let index = 0; index < storages.length; index++) { | |||
expect(rleaf.entry[0].bigInt()).to.be.eq(1n); | |||
}); | |||
|
|||
// https://github.com/iden3/go-merkletree-sql/issues/23 | |||
it('test issue 23', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't address an issue number in test name. May be it is ok to leave the issue reference in comments but better to name the test by exactly what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
No description provided.