worldcoin / signup-sequencer

signup-sequencer repository
MIT License
67 stars 33 forks source link

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

Closed piohei closed 4 months ago

piohei commented 4 months ago

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