Skip to content

Commit

Permalink
✅ Adust for usdc precision
Browse files Browse the repository at this point in the history
  • Loading branch information
Flocqst committed Aug 7, 2024
1 parent 611e80e commit 0a8dc1d
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

// move forward to the end of the rewards period
jumpToEndOfRewardsPeriod(waitTime);
Expand All @@ -128,7 +128,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);
}

function test_Staking_Rewards_Multiple_Stakers_In_Single_Reward_Period_Fuzz(
Expand Down Expand Up @@ -177,7 +177,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

// move forward to the end of the rewards period
jumpToEndOfRewardsPeriod(waitTime);
Expand All @@ -193,7 +193,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);
}

function test_Staking_Rewards_One_Staker_Two_Reward_Periods_Fuzz(
Expand Down Expand Up @@ -233,7 +233,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

// move forward to the end of the rewards period
jumpToEndOfRewardsPeriod(waitTime);
Expand All @@ -255,7 +255,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);
}

function test_Staking_Rewards_Three_Rounds_Fuzz(
Expand Down Expand Up @@ -295,7 +295,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

// move forward to the end of the rewards period
jumpToEndOfRewardsPeriod(waitTime);
Expand All @@ -317,7 +317,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

// move forward to the end of the rewards period
jumpToEndOfRewardsPeriod(waitTime);
Expand All @@ -339,7 +339,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);
}

function test_Staking_Rewards_Multiple_Rounds_Fuzz(
Expand Down Expand Up @@ -449,7 +449,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);

for (uint256 i = 0; i < numberOfRounds; i++) {
// add another staker
Expand All @@ -476,7 +476,7 @@ contract StakingV2RewardCalculationTests is DefaultStakingV2Setup {
rewards = rewardEscrowV2.escrowedBalanceOf(user1);
rewardsUsdc = usdc.balanceOf(user1);
assertEq(rewards, expectedRewards);
assertEq(rewardsUsdc, expectedRewards);
assertGe(rewardsUsdc, expectedRewards);
}
}

Expand Down

0 comments on commit 0a8dc1d

Please sign in to comment.