Skip to content

Commit

Permalink
chore: add casting
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Sep 11, 2024
1 parent 1c13158 commit 0285441
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/StakingRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ import {

it("Should set the right rewards token", async function () {
const { stakingRewards, rewardsToken } = await loadFixture(deployStakingRewardsFixture);
expect(getAddress(await stakingRewards.read.rewardsToken())).to.equal(getAddress(rewardsToken.address));
expect(getAddress(await stakingRewards.read.rewardsToken() as string)).to.equal(getAddress(rewardsToken.address));
});

it("Should set the right staking token", async function () {
const { stakingRewards, stakingToken } = await loadFixture(deployStakingRewardsFixture);
expect(getAddress(await stakingRewards.read.stakingToken())).to.equal(getAddress(stakingToken.address));
expect(getAddress(await stakingRewards.read.stakingToken() as string)).to.equal(getAddress(stakingToken.address));
});
});

Expand Down Expand Up @@ -186,7 +186,7 @@ import {
await time.increase(7 * 24 * 60 * 60); // 7 days

const earnedRewards = await stakingRewards.read.earned([stakingAccount1.account.address]);
expect(earnedRewards > 0n);
expect(earnedRewards as bigint > 0n);
});
});

Expand Down Expand Up @@ -224,7 +224,7 @@ import {
await time.increase(7 * 24 * 60 * 60); // 7 days

const rewardPerToken = await stakingRewards.read.rewardPerToken();
expect(rewardPerToken > 0n);
expect(rewardPerToken as bigint > 0n);
});
});

Expand Down Expand Up @@ -256,13 +256,13 @@ import {

await time.increase(7 * 24 * 60 * 60); // 7 days

const initialStakingBalance = await stakingToken.read.balanceOf([stakingAccount1.account.address]);
const initialRewardsBalance = await rewardsToken.read.balanceOf([stakingAccount1.account.address]);
const initialStakingBalance = await stakingToken.read.balanceOf([stakingAccount1.account.address]) as bigint;
const initialRewardsBalance = await rewardsToken.read.balanceOf([stakingAccount1.account.address]) as bigint;

await stakingRewards.write.exit({ account: stakingAccount1.account });

const finalStakingBalance = await stakingToken.read.balanceOf([stakingAccount1.account.address]);
const finalRewardsBalance = await rewardsToken.read.balanceOf([stakingAccount1.account.address]);
const finalStakingBalance = await stakingToken.read.balanceOf([stakingAccount1.account.address]) as bigint;
const finalRewardsBalance = await rewardsToken.read.balanceOf([stakingAccount1.account.address]) as bigint;

// Use Viem's comparison for big numbers
expect(finalStakingBalance > initialStakingBalance).to.be.true;
Expand Down

0 comments on commit 0285441

Please sign in to comment.