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

dusk-merkle: add bounds check at Tree::insert #92

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Conversation

ureeves
Copy link
Member

@ureeves ureeves commented Sep 9, 2024

A panic on an out of bounds insertion is expected in the merkle tree, however, the panic message is a bit cryptic. This commit adds a bounds check (index < capacity) and improves the error message such that it is clear to whomever calls it.

Resolves: #91

Copy link
Member

@herr-seppia herr-seppia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

A panic on an out of bounds insertion is expected in the merkle tree,
however, the panic message is a bit cryptic. This commit adds a bounds
check (`index < capacity`) and improves the error message such that it
is clear to whomever calls it.

Resolves: #91
@ureeves ureeves force-pushed the insert-bounds-check branch from b6ca0f4 to e422e58 Compare September 9, 2024 12:53
@ureeves ureeves merged commit 00f0ce9 into main Sep 9, 2024
4 of 5 checks passed
@ureeves ureeves deleted the insert-bounds-check branch September 9, 2024 12:55
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.

insert can panic due to Out of Bounds
2 participants