Stub out zk proof verification in marketplace tests
This commit is contained in:
parent
e59f0f961e
commit
e1657acdd0
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue