Skip to content

Commit

Permalink
πŸ“šβœ… use constants
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Oct 28, 2024
1 parent faeacdd commit 3e7ca1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/KSXVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ contract KSXVaultAuctionTest is KSXVaultTest {

ksxVault.createAuction(STARTING_BID);

vm.warp(block.timestamp + 1 weeks - 1);
vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION - 1);
assertEq(ksxVault.isAuctionReady(), false);
vm.warp(block.timestamp + 1);
assertEq(ksxVault.isAuctionReady(), true);
Expand All @@ -170,7 +170,7 @@ contract KSXVaultAuctionTest is KSXVaultTest {
vm.warp(block.timestamp + (DEFAULT_EPOCH_DURATION / 2));
assertEq(ksxVault.isAuctionReady(), false);
vm.prank(PDAOADDR);
ksxVault.setEpochDuration(1 days);
ksxVault.setEpochDuration(MIN_EPOCH_DURATION);
/// @dev you have to wait until the end of the epoch duration
/// you just set (we were midway through the day because of (DEFAULT_EPOCH_DURATION / 2))
vm.warp(block.timestamp + .5 days - 1);
Expand All @@ -184,20 +184,20 @@ contract KSXVaultAuctionTest is KSXVaultTest {
ksxVault.createAuction(STARTING_BID);
assertEq(ksxVault.isAuctionReady(), false);

vm.warp(block.timestamp + 1 days - 1);
vm.warp(block.timestamp + MIN_EPOCH_DURATION - 1);
assertEq(ksxVault.isAuctionReady(), false);
vm.warp(block.timestamp + 1);
assertEq(ksxVault.isAuctionReady(), true);
vm.prank(PDAOADDR);
ksxVault.setEpochDuration(4 weeks);
ksxVault.setEpochDuration(MAX_EPOCH_DURATION);
assertEq(ksxVault.isAuctionReady(), false);

vm.warp(block.timestamp + 3.5 weeks);
assertEq(ksxVault.isAuctionReady(), true);

vm.warp(DEFAULT_START_TIME + 4 weeks - 1);
vm.warp(DEFAULT_START_TIME + MAX_EPOCH_DURATION - 1);
assertEq(ksxVault.isAuctionReady(), false);
vm.warp(block.timestamp + 1 weeks + 1);
vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION + 1);
assertEq(ksxVault.isAuctionReady(), true);
}

Expand Down

0 comments on commit 3e7ca1a

Please sign in to comment.