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

Catch errors in bbs module #338

Merged
merged 1 commit into from Nov 15, 2021
Merged

Catch errors in bbs module #338

merged 1 commit into from Nov 15, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Oct 29, 2021

This PR changes functions using unwrap in src/bbs.rs to instead return a Result. This affects keypair generation and conversion functions. Error types using thiserror are added. This change is intended to make the code safer by being less likely to panic. Although it's possible these uses of unwrap would not panic in practice, these changes would then just represent erring on the side of caution.

In impl Serialize for BlsSecretKey, I was unable to remove the use of unwrap, so instead add a documentation comment that the function may panic.

@clehner clehner marked this pull request as ready for review October 29, 2021 14:01
@clehner clehner requested a review from sbihel November 1, 2021 16:10
@bumblefudge bumblefudge added this to the v0.3.1 milestone Nov 12, 2021
- Use Result instead of unwrap in keypair generation and conversion.
- Note serialize may panic
@clehner
Copy link
Contributor Author

clehner commented Nov 15, 2021

Rebasing and merging.

@clehner clehner merged commit d5549ef into main Nov 15, 2021
@clehner clehner deleted the fix/bbs-unwrap branch November 15, 2021 17:28
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.

None yet

3 participants