Skip to content
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

Fix restoring tree when there are no commitments added. #716

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

piohei
Copy link
Contributor

@piohei piohei commented Apr 26, 2024

Motivation

When empty tree was being restored from file starting index was 1 instead of 0. It shouldn't be a big deal for production but may be problematic in some test cases. And still it is a bug - so nice to be fixed.

Solution

When tree is being restored instead of using zero as default value None optional is used to indicate that actually there is no latest index as there are no used indexes at all.

PR Checklist

  • [ X] Added Tests
  • Added Documentation

@piohei piohei requested a review from a team as a code owner April 26, 2024 09:27
@piohei piohei force-pushed the fix_tree_restore branch from bb1ac3b to f6d36a0 Compare April 26, 2024 09:28
@piohei piohei force-pushed the fix_tree_restore branch from f6d36a0 to 9f937b5 Compare April 26, 2024 10:50
@Dzejkop Dzejkop merged commit 1721254 into worldcoin:main Apr 26, 2024
@piohei piohei deleted the fix_tree_restore branch April 29, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants