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

No more assert on result #346

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

huitseeker
Copy link
Contributor

@huitseeker huitseeker commented Feb 25, 2024

An assertion failure on a Result cannot output the useful message of the error.

This removes the systematic pattern of asserting on result states, specially when it comes to tests / benches.
Prohibits them for good measure, using clippy.

…ling

- Replaced assertions throughout multiple functions and tests with directly unwrapping results for better error handling and clarity on failures.
- Applied this change to methods like `prove_step`, `verify`, `test_inner`, and in areas like RecursiveSNARK, CompressedSNARK, and test functions across different scripts.
- Enhanced the error feedback mechanism during benchmarks for RecursiveSNARK, and CompressedSNARK.
- Simplified code further by removing unnecessary checks and variable assignments, and performing inline verification with cleanercode.
- Updated `.cargo/config.toml` with a new project-wide Clippy lint rule for assertion on result states.
Copy link
Contributor

@adr1anh adr1anh left a comment

Choose a reason for hiding this comment

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

This would've helped a while ago, very happy to see this refactor!

@huitseeker huitseeker added this pull request to the merge queue Feb 25, 2024
Merged via the queue into lurk-lang:dev with commit e73a98e Feb 25, 2024
9 checks passed
@huitseeker huitseeker deleted the no_more_assert_on_result branch February 25, 2024 10:26
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