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";
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue