Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Sep 11, 2024
1 parent 0285441 commit af662bd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/StakingRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
import hre from "hardhat";
import { getAddress, parseEther, formatEther, toBytes } from "viem";

const defaultSupply = 1e8;

// Mock token helper function
async function mockToken({
accounts,
synth = undefined,
name = 'name',
symbol = 'ABC',
supply = 1e8,
supply = defaultSupply,
skipInitialAllocation = false,
}: {
accounts: { account: { address: string } }[];
Expand Down Expand Up @@ -204,7 +206,7 @@ import {
await stakingRewards.write.withdraw([stakeAmount], { account: stakingAccount1.account });

expect(await stakingRewards.read.balanceOf([stakingAccount1.account.address])).to.equal(0n);
expect(await stakingToken.read.balanceOf([stakingAccount1.account.address])).to.equal(stakeAmount);
expect(await stakingToken.read.balanceOf([stakingAccount1.account.address])).to.equal(parseEther(defaultSupply.toString()));
});
});

Expand Down Expand Up @@ -259,7 +261,7 @@ import {
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 });
await stakingRewards.write.exit([], { account: stakingAccount1.account });

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

0 comments on commit af662bd

Please sign in to comment.