Skip to content

Commit

Permalink
fix mock dapp contract
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhiran committed Jan 7, 2025
1 parent 21b3949 commit 9296a68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/hex"
"encoding/json"
"log"
"log/slog"
"math/big"
"os"
"runtime"
Expand Down Expand Up @@ -50,7 +49,6 @@ func TestE2E(t *testing.T) {

// Deploy contract to local chain
contracts, err := services.DeployContract(chainEndpoint, payerHex)
slog.Error("failed to DeployContract", "error", err)
require.NoError(t, err)

// Setup clickhouse
Expand Down
2 changes: 1 addition & 1 deletion smartcontracts/contracts/test/MockDapp.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract MockProcessor {
contract MockDapp {
error CustomError();

uint8 public errorType;
Expand Down
8 changes: 4 additions & 4 deletions smartcontracts/contracts/test/MockDappLiveness.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract MockProcessor {
contract MockDappLiveness {
error CustomError();

uint8 public errorType;
Expand All @@ -27,17 +27,17 @@ contract MockProcessor {
} else if (errorType == 2) {
revert CustomError();
}

// Validate data length (78 uint256 values = 78 * 32 bytes)
require(_data.length == 78 * 32, "Invalid data length");

// Prepare function selector
bytes4 selector = bytes4(keccak256("verifyProof(uint256[8],uint256[2],uint256[2],uint256[66])"));

// Call verifier contract
(bool success, ) = verifier.staticcall(abi.encodePacked(selector, _data));
require(success, "Verifier call failed");

// TODO: cross-validate the public inputs which are the last 66 uint256 values in the _data
}
}

0 comments on commit 9296a68

Please sign in to comment.