Skip to content

Commit

Permalink
update dep + Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
critesjosh committed Dec 21, 2024
1 parent b78f7fa commit 8f455af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion with-foundry/lib/foundry-noir-helper
20 changes: 10 additions & 10 deletions with-foundry/test/Starter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ contract StarterTest is Test {
starter = new Starter(verifier);
}

function verifyProof() public {
function test_verifyProof() public {
noirHelper.withInput("x", 1).withInput("y", 1).withInput("return", 1);
(bytes32[] memory publicInputs, bytes memory proof) = noirHelper.generateProofAndClean(2);
(bytes32[] memory publicInputs, bytes memory proof) = noirHelper.generateProof("test_verifyProof", 2);
starter.verifyEqual(proof, publicInputs);
}

function wrongProof() public {
function test_wrongProof() public {
noirHelper.clean();
noirHelper.withInput("x", 1).withInput("y", 5).withInput("return", 5);
(bytes32[] memory publicInputs, bytes memory proof) = noirHelper.generateProofAndClean(2);
(bytes32[] memory publicInputs, bytes memory proof) = noirHelper.generateProof("test_wrongProof", 2);
vm.expectRevert();
starter.verifyEqual(proof, publicInputs);
}

function test_all() public {
// forge runs tests in parallel which messes with the read/writes to the proof file
// Run tests in wrapper to force them run sequentially
verifyProof();
wrongProof();
}
// function test_all() public {
// // forge runs tests in parallel which messes with the read/writes to the proof file
// // Run tests in wrapper to force them run sequentially
// verifyProof();
// wrongProof();
// }

}

0 comments on commit 8f455af

Please sign in to comment.