From c0d2ee0e3b404590189f9b7d1e05ff991b8c9d51 Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Thu, 13 Jul 2023 07:21:28 -0400 Subject: [PATCH] fix: Fix ZkSyncSpokePool unit test (#315) * Update ZkSync_Adapter.sol * Update ZkSync_SpokePool.ts --- contracts/chain-adapters/ZkSync_Adapter.sol | 2 +- test/chain-specific-spokepools/ZkSync_SpokePool.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/chain-adapters/ZkSync_Adapter.sol b/contracts/chain-adapters/ZkSync_Adapter.sol index 7d1430d4..ef295313 100644 --- a/contracts/chain-adapters/ZkSync_Adapter.sol +++ b/contracts/chain-adapters/ZkSync_Adapter.sol @@ -93,7 +93,7 @@ contract ZkSync_Adapter is AdapterInterface { ZkBridgeLike public constant zkErc20Bridge = ZkBridgeLike(0x57891966931Eb4Bb6FB81430E6cE0A03AAbDe063); // Set l1Weth at construction time to make testing easier. TODO: Think of some way to be able to hardcode this - // while making testing easy. + // while keeping unit tests easy to write with custom WETH that we can mint/transfer. WETH9Interface public immutable l1Weth; event ZkSyncMessageRelayed(bytes32 canonicalTxHash); diff --git a/test/chain-specific-spokepools/ZkSync_SpokePool.ts b/test/chain-specific-spokepools/ZkSync_SpokePool.ts index 6fd620d0..803b94ad 100644 --- a/test/chain-specific-spokepools/ZkSync_SpokePool.ts +++ b/test/chain-specific-spokepools/ZkSync_SpokePool.ts @@ -72,7 +72,7 @@ describe("ZkSync Spoke Pool", function () { zkSyncSpokePool = await hre.upgrades.deployProxy( await getContractFactory("ZkSync_SpokePool", owner), [0, zkErc20Bridge.address, owner.address, hubPool.address, weth.address], - { kind: "uups" } + { kind: "uups", unsafeAllow: ["delegatecall"] } ); await seedContract(zkSyncSpokePool, relayer, [dai], weth, amountHeldByPool); @@ -82,7 +82,7 @@ describe("ZkSync Spoke Pool", function () { // TODO: Could also use upgrades.prepareUpgrade but I'm unclear of differences const implementation = await hre.upgrades.deployImplementation( await getContractFactory("ZkSync_SpokePool", owner), - { kind: "uups" } + { kind: "uups", unsafeAllow: ["delegatecall"] } ); // upgradeTo fails unless called by cross domain admin