Direct people towards MockProver::assert_satisfied
in the documentation of MockProver::verify
#725
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.
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 theDebug
impl of the errors if any occur. This is not very usable, but it's also not something we can fix (as theDebug
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 toassert_eq!(prover.verify(), Ok(()))
, except that it also pretty-prints the errors. We note this in the documentation ofMockProver::assert_satisfied
, but we should also note this in the documentation ofMockProver::verify
(so that developers are more likely to see it in their IDEs when usingMockProver
).The text was updated successfully, but these errors were encountered: