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

Fix error in toBeTrue method #111

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vite-hardhat/tests/uh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ describe('UltraHonk', () => {
const input = { x: 1, y: 2 };
const { witness } = await noir.execute(input);
correctProof = await backend.generateProof(witness);
expect(correctProof.proof instanceof Uint8Array).toBeTrue;
expect(correctProof.proof instanceof Uint8Array).toBe(true);
});

test('Should verify valid proof for correct input', async () => {
const verification = await backend.verifyProof(correctProof);
expect(verification).toBeTrue;
expect(verification).toBe(true);
});

test('Should fail to generate valid proof for incorrect input', async () => {
Expand All @@ -42,7 +42,7 @@ describe('UltraHonk', () => {
const { witness } = await noir.execute(input);
const incorrectProof = await backend.generateProof(witness);
} catch (err) {
expect(err instanceof Error).toBeTrue;
expect(err instanceof Error).toBe(true);
const error = err as Error;
expect(error.message).toContain('Cannot satisfy constraint');
}
Expand Down
8 changes: 4 additions & 4 deletions vite-hardhat/tests/up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ describe('UltraPlonk', () => {
const input = { x: 1, y: 2 };
const { witness } = await noir.execute(input);
correctProof = await backend.generateProof(witness);
expect(correctProof.proof instanceof Uint8Array).toBeTrue;
expect(correctProof.proof instanceof Uint8Array).toBe(true);
});

test('Should verify valid proof for correct input', async () => {
const verification = await backend.verifyProof(correctProof);
expect(verification).toBeTrue;
expect(verification).toBe(true);
});

test('Should verify valid proof for correct input on a smart contract', async () => {
Expand All @@ -43,7 +43,7 @@ describe('UltraPlonk', () => {
bytesToHex(correctProof.proof),
correctProof.publicInputs as `0x${string}`[],
]);
expect(res).toBeTrue;
expect(res).toBe(true);
});

test('Should fail to generate valid proof for incorrect input', async () => {
Expand All @@ -52,7 +52,7 @@ describe('UltraPlonk', () => {
const { witness } = await noir.execute(input);
const incorrectProof = await backend.generateProof(witness);
} catch (err) {
expect(err instanceof Error).toBeTrue;
expect(err instanceof Error).toBe(true);
const error = err as Error;
expect(error.message).toContain('Cannot satisfy constraint');
}
Expand Down
Loading