mirror of
https://github.com/status-im/codex-contracts-eth.git
synced 2025-03-04 01:50:28 +00:00
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…
x
Reference in New Issue
Block a user