From 9296a68478335e086c4c873bb5c371eda7dfdb79 Mon Sep 17 00:00:00 2001 From: huangzhiran Date: Tue, 7 Jan 2025 11:50:05 +0800 Subject: [PATCH] fix mock dapp contract --- e2e/e2e_test.go | 2 -- smartcontracts/contracts/test/MockDapp.sol | 2 +- smartcontracts/contracts/test/MockDappLiveness.sol | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 56b12e1f..fc7c7163 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "encoding/json" "log" - "log/slog" "math/big" "os" "runtime" @@ -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 diff --git a/smartcontracts/contracts/test/MockDapp.sol b/smartcontracts/contracts/test/MockDapp.sol index adbc28b9..7d2eadc5 100644 --- a/smartcontracts/contracts/test/MockDapp.sol +++ b/smartcontracts/contracts/test/MockDapp.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -contract MockProcessor { +contract MockDapp { error CustomError(); uint8 public errorType; diff --git a/smartcontracts/contracts/test/MockDappLiveness.sol b/smartcontracts/contracts/test/MockDappLiveness.sol index 3e1fc4cb..4e76001d 100644 --- a/smartcontracts/contracts/test/MockDappLiveness.sol +++ b/smartcontracts/contracts/test/MockDappLiveness.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -contract MockProcessor { +contract MockDappLiveness { error CustomError(); uint8 public errorType; @@ -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 } }