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

Direct people towards MockProver::assert_satisfied in the documentation of MockProver::verify #725

Open
str4d opened this issue Jan 24, 2023 · 1 comment
Labels
A-dev-tooling Area: Developer tooling A-errors Area: Error handling E-good-first-issue Effort: Suitable for someone new to the codebase. E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@str4d
Copy link
Contributor

str4d commented Jan 24, 2023

MockProver::verify returns the detected errors as Rust types. This is intended for implementing negative tests: checking that when constructing a circuit in a specific invalid way, you get an expected error.

However, many developers call it in their positive tests as assert_eq!(prover.verify(), Ok(())), which prints the Debug impl of the errors if any occur. This is not very usable, but it's also not something we can fix (as the Debug impls are correctly printing what they should; we don't want post-processing on those).

Instead, developers should use MockProver::assert_satisfied which is identical in semantics to assert_eq!(prover.verify(), Ok(())), except that it also pretty-prints the errors. We note this in the documentation of MockProver::assert_satisfied, but we should also note this in the documentation of MockProver::verify (so that developers are more likely to see it in their IDEs when using MockProver).

@str4d str4d added A-dev-tooling Area: Developer tooling A-errors Area: Error handling labels Jan 24, 2023
@str4d str4d added E-good-first-issue Effort: Suitable for someone new to the codebase. E-help-wanted Call for participation: Help is requested to fix this issue. labels Feb 3, 2023
@ImmanuelSegol
Copy link
Contributor

@str4d ill do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dev-tooling Area: Developer tooling A-errors Area: Error handling E-good-first-issue Effort: Suitable for someone new to the codebase. E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

2 participants