From e1657acdd0c2f4e831e3252efb2ce8a5215c7f62 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 15 Jan 2024 16:28:27 +0100 Subject: [PATCH] Stub out zk proof verification in marketplace tests --- contracts/TestVerifier.sol | 14 ++++++++++++-- test/Marketplace.test.js | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/contracts/TestVerifier.sol b/contracts/TestVerifier.sol index b3d3b5f..e69b9d2 100644 --- a/contracts/TestVerifier.sol +++ b/contracts/TestVerifier.sol @@ -4,12 +4,22 @@ pragma solidity ^0.8.8; import "./Verifier.sol"; contract TestVerifier is IVerifier { + bool private _proofsAreValid; + + constructor() { + _proofsAreValid = true; + } + + function setProofsAreValid(bool proofsAreValid) public { + _proofsAreValid = proofsAreValid; + } + function verifyProof( uint[2] calldata, uint[2][2] calldata, uint[2] calldata, uint[3] calldata - ) external pure returns (bool) { - return false; + ) external view returns (bool) { + return _proofsAreValid; } } diff --git a/test/Marketplace.test.js b/test/Marketplace.test.js index 77c0760..5244602 100644 --- a/test/Marketplace.test.js +++ b/test/Marketplace.test.js @@ -215,9 +215,9 @@ describe("Marketplace", function () { }) it("is rejected when proof is incorrect", async function () { - let invalid = hexlify([]) + await verifier.setProofsAreValid(false) await expect( - marketplace.fillSlot(slot.request, slot.index, invalid) + marketplace.fillSlot(slot.request, slot.index, proof) ).to.be.revertedWith("Invalid proof") })