Skip to content

Commit 4d57e9b

Browse files
committed
fix
1 parent def3a9b commit 4d57e9b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

test/evm/hardhat/chain-specific-spokepools/ZkSync_SpokePool.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ describe("ZkSync Spoke Pool", function () {
5858
const cctpTokenMessenger = ZERO_ADDRESS; // Not currently supported.
5959

6060
let hubPool: Contract, zkSyncSpokePool: Contract, dai: Contract, usdc: Contract, weth: Contract;
61-
let l2Usdc: string, l2Dai: string, crossDomainAliasAddress, crossDomainAlias: SignerWithAddress;
61+
let l2Dai: string, crossDomainAliasAddress, crossDomainAlias: SignerWithAddress;
6262
let owner: SignerWithAddress, relayer: SignerWithAddress, rando: SignerWithAddress;
6363
let zkErc20Bridge: FakeContract, zkUSDCBridge: FakeContract, l2Eth: FakeContract;
6464
let constructorArgs: unknown[];
6565

6666
beforeEach(async function () {
6767
[owner, relayer, rando] = await ethers.getSigners();
68-
({ weth, dai, usdc, l2Usdc, l2Dai, hubPool } = await hubPoolFixture());
68+
({ weth, dai, usdc, l2Dai, hubPool } = await hubPoolFixture());
6969

7070
// Create an alias for the Owner. Impersonate the account. Crate a signer for it and send it ETH.
7171
crossDomainAliasAddress = avmL1ToL2Alias(owner.address); // @dev Uses same aliasing algorithm as Arbitrum
@@ -76,14 +76,7 @@ describe("ZkSync Spoke Pool", function () {
7676
zkErc20Bridge = await smock.fake(abiData.erc20DefaultBridge.abi, { address: ERC20_BRIDGE });
7777
zkUSDCBridge = await smock.fake(abiData.erc20DefaultBridge.abi, { address: USDC_BRIDGE });
7878
l2Eth = await smock.fake(abiData.eth.abi, { address: abiData.eth.address });
79-
constructorArgs = [
80-
weth.address,
81-
usdc.address, // l2Usdc is just an address, not deployed.
82-
zkUSDCBridge.address,
83-
cctpTokenMessenger,
84-
60 * 60,
85-
9 * 60 * 60,
86-
];
79+
constructorArgs = [weth.address, usdc.address, zkUSDCBridge.address, cctpTokenMessenger, 60 * 60, 9 * 60 * 60];
8780

8881
zkSyncSpokePool = await hre.upgrades.deployProxy(
8982
await getContractFactory("ZkSync_SpokePool", owner),
@@ -192,22 +185,28 @@ describe("ZkSync Spoke Pool", function () {
192185
);
193186
await zkSyncSpokePool.connect(crossDomainAlias).upgradeTo(implementation);
194187

195-
const { leaves, tree } = await constructSingleRelayerRefundTree(l2Usdc, await zkSyncSpokePool.callStatic.chainId());
188+
const { leaves, tree } = await constructSingleRelayerRefundTree(
189+
usdc.address,
190+
await zkSyncSpokePool.callStatic.chainId()
191+
);
196192
await zkSyncSpokePool.connect(crossDomainAlias).relayRootBundle(tree.getHexRoot(), mockTreeRoot);
197193
await zkSyncSpokePool.connect(relayer).executeRelayerRefundLeaf(0, leaves[0], tree.getHexProof(leaves[0]));
198194

199195
// This should have sent tokens back to L1. Check the correct methods on the gateway are correctly called.
200196
expect(zkErc20Bridge.withdraw).to.have.been.calledOnce;
201-
expect(zkErc20Bridge.withdraw).to.have.been.calledWith(hubPool.address, l2Usdc, amountToReturn);
197+
expect(zkErc20Bridge.withdraw).to.have.been.calledWith(hubPool.address, usdc.address, amountToReturn);
202198
});
203199
it("Bridge tokens to hub pool correctly calls the custom USDC L2 Bridge for Circle Bridged USDC", async function () {
204-
const { leaves, tree } = await constructSingleRelayerRefundTree(l2Usdc, await zkSyncSpokePool.callStatic.chainId());
200+
const { leaves, tree } = await constructSingleRelayerRefundTree(
201+
usdc.address,
202+
await zkSyncSpokePool.callStatic.chainId()
203+
);
205204
await zkSyncSpokePool.connect(crossDomainAlias).relayRootBundle(tree.getHexRoot(), mockTreeRoot);
206205
await zkSyncSpokePool.connect(relayer).executeRelayerRefundLeaf(0, leaves[0], tree.getHexProof(leaves[0]));
207206

208207
// This should have sent tokens back to L1. Check the correct methods on the gateway are correctly called.
209208
expect(zkUSDCBridge.withdraw).to.have.been.calledOnce;
210-
expect(zkUSDCBridge.withdraw).to.have.been.calledWith(hubPool.address, l2Usdc, amountToReturn);
209+
expect(zkUSDCBridge.withdraw).to.have.been.calledWith(hubPool.address, usdc.address, amountToReturn);
211210
});
212211
it("Bridge ETH to hub pool correctly calls the Standard L2 Bridge for WETH, including unwrap", async function () {
213212
const { leaves, tree } = await constructSingleRelayerRefundTree(

0 commit comments

Comments
 (0)