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

Field.assertBoolean does not throw with invalid input #469

Closed
MartinMinkov opened this issue Oct 5, 2022 · 0 comments · Fixed by #902
Closed

Field.assertBoolean does not throw with invalid input #469

MartinMinkov opened this issue Oct 5, 2022 · 0 comments · Fixed by #902
Labels
bug Something isn't working

Comments

@MartinMinkov
Copy link
Contributor

Description

The comments of Field.assertBoolean are as follows:

Assert that this [[Field]] is either 0 or 1

However, it seems as though calling assertBoolean on Field elements that are not 0 or 1 does not cause an assertion failure.

Reproduce

Code

import { Field, isReady, shutdown } from 'snarkyjs';
await isReady;
Circuit.runAndCheck(() => {
  Field(512).assertBoolean(); // Nothing is thrown.
});
shutdown();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants