Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle the precondition in path length from key when the number …
…of leaves is <= 1 (#274) <!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview Fix the issue with path length from key when the number of leaves is <= 1. This happens when the key and the number of leaves are consecutive numbers. ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved the `pathLengthFromKey` function to handle cases with minimal leaves efficiently. - **Tests** - Added new test cases to ensure the reliability of binary Merkle proofs with various key and leaves scenarios. - Enhanced existing tests with additional assertions for better coverage. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information