Skip to content

Commit

Permalink
Fix fork tests of CCIP
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Nov 26, 2024
1 parent 87986c5 commit e020b5f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions contracts/test/zapper/woethccipzapper.mainnet.fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ describe("ForkTest: WOETH CCIP Zapper", function () {
});

it("zap(): Should zap ETH and send WOETH to CCIP TokenPool", async () => {
const { woethZapper, woethOnSourceChain, josh } = fixture;
const { woethZapper, woethOnSourceChain, woeth, josh } = fixture;
const depositAmount = parseUnits("5");
const feeAmount = await woethZapper.getFee(depositAmount, josh.address);
const expectedAmountToBeSentToPool = depositAmount.sub(feeAmount);
const expectedAmountToBeSentToPool = await woeth.convertToShares(
depositAmount.sub(feeAmount)
);
const poolBalanceBefore = await woethOnSourceChain.balanceOf(
addresses.mainnet.ccipWoethTokenPool
);
Expand All @@ -36,7 +38,7 @@ describe("ForkTest: WOETH CCIP Zapper", function () {
);
expect(poolBalanceAfter.sub(poolBalanceBefore)).to.approxEqualTolerance(
expectedAmountToBeSentToPool,
10
1
);
});
it("zap(): Should emit Zap event with args", async () => {
Expand Down Expand Up @@ -79,10 +81,12 @@ describe("ForkTest: WOETH CCIP Zapper", function () {
});
});
it("receive(): Should zap ETH and send WOETH to CCIP TokenPool", async () => {
const { woethZapper, woethOnSourceChain, josh } = fixture;
const { woethZapper, woethOnSourceChain, woeth, josh } = fixture;
const depositAmount = parseUnits("5");
const feeAmount = await woethZapper.getFee(depositAmount, josh.address);
const expectedAmountToBeSentToPool = depositAmount.sub(feeAmount);
const expectedAmountToBeSentToPool = await woeth.convertToShares(
depositAmount.sub(feeAmount)
);
const poolBalanceBefore = await woethOnSourceChain.balanceOf(
addresses.mainnet.ccipWoethTokenPool
);
Expand All @@ -95,7 +99,7 @@ describe("ForkTest: WOETH CCIP Zapper", function () {
);
expect(poolBalanceAfter.sub(poolBalanceBefore)).to.approxEqualTolerance(
expectedAmountToBeSentToPool,
10
1
);
});
it("receive(): Should emit Zap event with args", async () => {
Expand Down

0 comments on commit e020b5f

Please sign in to comment.