Skip to content

Commit

Permalink
✅ rename function helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Flocqst committed Jul 17, 2024
1 parent fb03e81 commit 6336698
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/foundry/unit/StakingRewardsV2/StakingV2Checkpointing.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,14 @@ contract StakingV2CheckpointingTests is DefaultStakingV2Setup {
}

function test_balanceAtTime_With_Unstake_Before_Block() public {
uint256 timestampToFind = xCooldownPeriods(4);
uint256 timestampToFind = xPeriods(4);
uint256 expectedValue;
uint256 totalStaked;

for (uint256 i = 0; i < 10; i++) {
uint256 amount = TEST_VALUE;
totalStaked += amount;
if (block.timestamp == xCooldownPeriods(2)) {
if (block.timestamp == xPeriods(2)) {
stakingRewardsV2.unstake(amount);
totalStaked -= amount;
}
Expand All @@ -562,14 +562,14 @@ contract StakingV2CheckpointingTests is DefaultStakingV2Setup {
}

function test_balanceAtTime_With_Unstake_After_Block() public {
uint256 timestampToFind = xCooldownPeriods(4);
uint256 timestampToFind = xPeriods(4);
uint256 expectedValue;
uint256 totalStaked;

for (uint256 i = 0; i < 10; i++) {
uint256 amount = TEST_VALUE;
totalStaked += amount;
if (block.timestamp == xCooldownPeriods(5)) {
if (block.timestamp == xPeriods(5)) {
stakingRewardsV2.unstake(amount);
totalStaked -= amount;
}
Expand All @@ -586,22 +586,22 @@ contract StakingV2CheckpointingTests is DefaultStakingV2Setup {
}

function test_balanceAtTime_With_Unstake_Before_And_After_Block() public {
uint256 timestampToFind = xCooldownPeriods(4);
uint256 timestampToFind = xPeriods(4);
uint256 expectedValue;
uint256 totalStaked;

for (uint256 i = 0; i < 10; i++) {
uint256 amount = TEST_VALUE;
totalStaked += amount;
fundAccountAndStakeV2(address(this), amount);
if (block.timestamp == xCooldownPeriods(2)) {
if (block.timestamp == xPeriods(2)) {
vm.warp(block.timestamp + 1);
stakingRewardsV2.unstake(amount);
stakingRewardsV2.unstake(amount);
totalStaked -= amount;
totalStaked -= amount;
}
if (block.timestamp == xCooldownPeriods(5)) {
if (block.timestamp == xPeriods(5)) {
vm.warp(block.timestamp + 1);
stakingRewardsV2.unstake(amount);
stakingRewardsV2.unstake(amount);
Expand Down Expand Up @@ -930,7 +930,7 @@ contract StakingV2CheckpointingTests is DefaultStakingV2Setup {
Helpers
//////////////////////////////////////////////////////////////*/

function xCooldownPeriods(uint256 numCooldowns) public pure returns (uint256) {
function xPeriods(uint256 numCooldowns) public pure returns (uint256) {
return 1 + (numCooldowns * 1);
}
}

0 comments on commit 6336698

Please sign in to comment.