Skip to content

Commit

Permalink
✅ test_compound add assert
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Oct 28, 2024
1 parent c9e48f6 commit bf210e9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ contract StakingRewardsV2CompoundTests is DefaultStakingV2Setup {
stakingRewardsV2.stake(TEST_VALUE);

uint256 initialBalance = kwenta.balanceOf(address(this));
uint256 initialStakedBalance = stakingRewardsV2.balanceOf(address(this));

// configure reward rate
addNewRewardsToStakingRewardsV2(TEST_VALUE, 0);
Expand All @@ -30,8 +31,10 @@ contract StakingRewardsV2CompoundTests is DefaultStakingV2Setup {

// check all rewards were staked and that staker balance increased
uint256 finalBalance = kwenta.balanceOf(address(this));
uint256 finalStakedBalance = stakingRewardsV2.balanceOf(address(this));
assertEq(initialBalance, finalBalance);
assertGt(stakingRewardsV2.balanceOf(address(this)), TEST_VALUE);
assertGt(finalStakedBalance, initialStakedBalance);
assertGt(finalStakedBalance, TEST_VALUE);
}

function test_compound_Fuzz(uint32 initialStake, uint32 newRewards) public {
Expand All @@ -45,6 +48,7 @@ contract StakingRewardsV2CompoundTests is DefaultStakingV2Setup {
stakingRewardsV2.stake(initialStake);

uint256 initialBalance = kwenta.balanceOf(address(this));
uint256 initialStakedBalance = stakingRewardsV2.balanceOf(address(this));

// configure reward rate
addNewRewardsToStakingRewardsV2(newRewards, 0);
Expand All @@ -57,7 +61,9 @@ contract StakingRewardsV2CompoundTests is DefaultStakingV2Setup {

// check all rewards were staked and that staker balance increased
uint256 finalBalance = kwenta.balanceOf(address(this));
uint256 finalStakedBalance = stakingRewardsV2.balanceOf(address(this));
assertEq(initialBalance, finalBalance);
assertGt(finalStakedBalance, initialStakedBalance);
assertGt(stakingRewardsV2.balanceOf(address(this)), initialStake);
}

Expand Down

0 comments on commit bf210e9

Please sign in to comment.