-
Notifications
You must be signed in to change notification settings - Fork 34
Generalize Circuit Logic and Add Unit Tests in main.nr #46
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
Generalize Circuit Logic and Add Unit Tests in main.nr #46
Conversation
Thanks for you contributions. I just added some new issues and tagged them with |
Thanks for the follow-up, @critesjosh! I appreciate you tagging me and
highlighting these issues.
I'd be happy to take on some of these. The following sound especially
interesting to me:
- ✅ Update/remove `lib_examples/base64_example` (#49)
- ✅ Add string search example using lib (#48)
I'll start looking into them and open PRs soon. Let me know if you have any
specific expectations or guidelines before I begin.
Thanks again!
…On Thu, Jun 5, 2025 at 5:22 AM josh crites ***@***.***> wrote:
*critesjosh* left a comment (noir-lang/noir-examples#46)
<#46 (comment)>
Thanks for you contributions. I just added some new issues and tagged them
with good first issue, would you be interested in taking on any of these?
<https://github.com/noir-lang/noir-examples/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22>
—
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJ3FDG6X6SWMBZ5F2PYFJKT3B6SWVAVCNFSM6AAAAAB6MHCKX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNBSGUZTOOJYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @critesjosh ! 👋 I've just synced everything with the latest changes and checked out this PR locally to ensure everything is clean and up to date. Let me know if there's anything else you'd like me to adjust or improve! Looking forward to your feedback—thanks for taking the time to review it! 🙏 |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Hi @critesjosh, Thanks for your work on the project! I have a couple of quick questions and would appreciate your clarification: Has the proof generation using the bb CLI changed recently to no longer require splitting the proof and public inputs into two separate files? If so, will this be the new standard format going forward? I also have seen a socket security image here—could you explain what it represents or its significance in the context of the project? Thanks in advance! Best regards |
Hi @critesjosh ! 👋 I've just synced everything with the latest changes and checked out this PR locally to ensure everything is clean and up to date. Let me know if there's anything else you'd like me to adjust or improve! Looking forward to your feedback—thanks for taking the time to review it! 🙏 |
Hi @critesjosh. When you get a chance, I’d appreciate your review on these changes.
Let me know if you'd like me to add any test cases or make adjustments!
Description
Generalized the circuit logic in
main.nr
:Replaced the hardcoded assertion
x * 2 + y == 9
with a parameterized version:x * 2 + y == expected
.This makes the circuit reusable for different inputs and expected outputs.
Added unit tests to verify correct behavior:
test_correct_values_case1
andtest_correct_values_case2
test valid input-output combinations.Left a commented-out failing test (
test_incorrect_expected
) to illustrate how the circuit responds to invalid expectations.Problem*
The original circuit was hardcoded to assert that
x * 2 + y == 9
, limiting its reusability and flexibility.Resolves
Summary*
This PR generalizes the Noir circuit in
main.nr
by:x * 2 + y == expected
.test_correct_values_case1
andtest_correct_values_case2
) to validate correct behavior.test_incorrect_expected
) to illustrate failure behavior.Additional Context
This improvement will help others reuse the same circuit for a range of values without changing the source code each time.
PR Checklist*
cargo fmt
on default settings.