Stub out zk proof verification in marketplace tests

This commit is contained in:
Mark Spanbroek 2024-01-15 16:28:27 +01:00 committed by markspanbroek
parent e59f0f961e
commit e1657acdd0
2 changed files with 14 additions and 4 deletions

View File

@ -4,12 +4,22 @@ pragma solidity ^0.8.8;
import "./Verifier.sol"; import "./Verifier.sol";
contract TestVerifier is IVerifier { contract TestVerifier is IVerifier {
bool private _proofsAreValid;
constructor() {
_proofsAreValid = true;
}
function setProofsAreValid(bool proofsAreValid) public {
_proofsAreValid = proofsAreValid;
}
function verifyProof( function verifyProof(
uint[2] calldata, uint[2] calldata,
uint[2][2] calldata, uint[2][2] calldata,
uint[2] calldata, uint[2] calldata,
uint[3] calldata uint[3] calldata
) external pure returns (bool) { ) external view returns (bool) {
return false; return _proofsAreValid;
} }
} }

View File

@ -215,9 +215,9 @@ describe("Marketplace", function () {
}) })
it("is rejected when proof is incorrect", async function () { it("is rejected when proof is incorrect", async function () {
let invalid = hexlify([]) await verifier.setProofsAreValid(false)
await expect( await expect(
marketplace.fillSlot(slot.request, slot.index, invalid) marketplace.fillSlot(slot.request, slot.index, proof)
).to.be.revertedWith("Invalid proof") ).to.be.revertedWith("Invalid proof")
}) })