Skip to content

Commit

Permalink
Fix integration test for zksync era-test-node
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Oct 21, 2024
1 parent e5c2adf commit e7e1eab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
29 changes: 10 additions & 19 deletions packages/contracts/test/IntegrationZKSync.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../src/EmailAuth.sol";
import "../src/utils/Verifier.sol";
import "../src/utils/Groth16Verifier.sol";
import "../src/utils/ForwardDKIMRegistry.sol";
import "./helpers/SimpleWallet.sol";
import "./helpers/RecoveryControllerZKSync.sol";
import "forge-std/console.sol";
import "../src/utils/ZKSyncCreate2Factory.sol";
import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol";
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";

contract IntegrationZKSyncTest is Test {
using Strings for *;
using console for *;

EmailAuth emailAuth;
Verifier verifier;
ForwardDKIMRegistry dkim;
UserOverrideableDKIMRegistry dkim;

RecoveryControllerZKSync recoveryControllerZKSync;
SimpleWallet simpleWallet;
Expand Down Expand Up @@ -54,27 +54,18 @@ contract IntegrationZKSyncTest is Test {
// Create DKIM registry
UserOverrideableDKIMRegistry overrideableDkimImpl = new UserOverrideableDKIMRegistry();
{
ForwardDKIMRegistry forwardDkimImpl = new ForwardDKIMRegistry();
ERC1967Proxy forwardDkimProxy = new ERC1967Proxy(
address(forwardDkimImpl),
ERC1967Proxy overrideableDkimProxy = new ERC1967Proxy(
address(overrideableDkimImpl),
abi.encodeCall(
forwardDkimImpl.initializeWithUserOverrideableDKIMRegistry,
(
msg.sender,
address(overrideableDkimImpl),
signer,
setTimeDelay
)
overrideableDkimImpl.initialize,
(msg.sender, signer, setTimeDelay)
)
);
dkim = ForwardDKIMRegistry(address(forwardDkimProxy));
dkim = UserOverrideableDKIMRegistry(address(overrideableDkimProxy));
}
{
UserOverrideableDKIMRegistry overrideableDkimProxy = UserOverrideableDKIMRegistry(
address(dkim.sourceDKIMRegistry())
);
string memory signedMsg = overrideableDkimProxy.computeSignedMsg(
overrideableDkimProxy.SET_PREFIX(),
string memory signedMsg = dkim.computeSignedMsg(
dkim.SET_PREFIX(),
domainName,
publicKeyHash
);
Expand All @@ -83,7 +74,7 @@ contract IntegrationZKSyncTest is Test {
);
(uint8 v, bytes32 r, bytes32 s) = vm.sign(1, digest);
bytes memory signature = abi.encodePacked(r, s, v);
overrideableDkimProxy.setDKIMPublicKeyHash(
dkim.setDKIMPublicKeyHash(
domainName,
publicKeyHash,
signer,
Expand Down
1 change: 0 additions & 1 deletion packages/contracts/test/helpers/DeploymentHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.s

// // FOR_ZKSYNC:START
// import {ZKSyncCreate2Factory} from "../../src/utils/ZKSyncCreate2Factory.sol";
// import "../../src/utils/ForwardDKIMRegistry.sol";
// import {RecoveryControllerZKSync, EmailAccountRecoveryZKSync} from "./RecoveryControllerZKSync.sol";
// // FOR_ZKSYNC:END

Expand Down

0 comments on commit e7e1eab

Please sign in to comment.