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

sealable-trie: propagate decode error rather than panicking #53

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

mina86
Copy link
Collaborator

@mina86 mina86 commented Oct 23, 2023

Reduce amount of potential panics by propagating errors from decoding
invalid raw nodes. Those errors should never happen since we write
the raw nodes and thus guarantee valid representation but in case the
code is ever used on data that needs validation it’s safer to detect
and propagate errors.

The crux of the change is in RawNode::decode and Reference::from_raw
methods in nodes.rs file. The rest of the changes is just adapting to
RawNode::decode’s return type change.

@mina86 mina86 requested a review from dhruvja October 23, 2023 18:40
@mina86 mina86 merged commit e6a12d4 into master Oct 23, 2023
4 checks passed
@mina86 mina86 deleted the mpn/e branch October 23, 2023 19:40
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