diff --git a/e2e/services/contractdeploy.go b/e2e/services/contractdeploy.go index 19ec1413..eee90a39 100644 --- a/e2e/services/contractdeploy.go +++ b/e2e/services/contractdeploy.go @@ -21,7 +21,7 @@ var ( mockProjectRe = regexp.MustCompile(`MockProject deployed to (\S+)`) wsProjectRe = regexp.MustCompile(`W3bstreamProject deployed to (\S+)`) routerRe = regexp.MustCompile(`W3bstreamRouter deployed to (\S+)`) - mockDappRe = regexp.MustCompile(`MockProcessor deployed to (\S+)`) + mockDappRe = regexp.MustCompile(`MockDapp deployed to (\S+)`) projectRewardRe = regexp.MustCompile(`W3bstreamProjectReward deployed to (\S+)`) debitsRe = regexp.MustCompile(`W3bstreamDebits deployed to (\S+)`) ioIDRe = regexp.MustCompile(`MockIoID deployed to (\S+)`) diff --git a/smartcontracts/contracts/test/MockDapp.sol b/smartcontracts/contracts/test/MockDapp.sol new file mode 100644 index 00000000..adbc28b9 --- /dev/null +++ b/smartcontracts/contracts/test/MockDapp.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +contract MockProcessor { + error CustomError(); + + uint8 public errorType; + + function setErrorType(uint8 _errorType) external { + errorType = _errorType; + } + + function process( + uint256 _projectId, + bytes32 _taskId, + address _prover, + address _deviceId, + bytes calldata _data + ) external view { + if (errorType == 1) { + require(false, "Normal Error"); + } else if (errorType == 2) { + revert CustomError(); + } + } +} diff --git a/smartcontracts/contracts/test/MockProcessor.sol b/smartcontracts/contracts/test/MockDappLiveness.sol similarity index 100% rename from smartcontracts/contracts/test/MockProcessor.sol rename to smartcontracts/contracts/test/MockDappLiveness.sol diff --git a/smartcontracts/scripts/deploy.ts b/smartcontracts/scripts/deploy.ts index da6e2c1b..b825ffb3 100644 --- a/smartcontracts/scripts/deploy.ts +++ b/smartcontracts/scripts/deploy.ts @@ -17,9 +17,13 @@ async function main() { } else { const gnarkVerifier = await ethers.deployContract('Verifier', []); await gnarkVerifier.waitForDeployment(); - const MockProcessor = await ethers.deployContract('MockProcessor', [gnarkVerifier.target]); - await MockProcessor.waitForDeployment(); - console.log(`MockProcessor deployed to ${MockProcessor.target}`); + const MockDappLiveness = await ethers.deployContract('MockDappLiveness', [gnarkVerifier.target]); + await MockDappLiveness.waitForDeployment(); + console.log(`MockDappLiveness deployed to ${MockDappLiveness.target}`); + + const MockDapp = await ethers.deployContract('MockDapp', []); + await MockDapp.waitForDeployment(); + console.log(`MockDapp deployed to ${MockDapp.target}`); } if (process.env.PROJECT_REGISTRATION_FEE) { projectRegistrationFee = process.env.PROJECT_REGISTRATION_FEE