Skip to content

Commit

Permalink
✅ test_isAuctionReady_next_week_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Oct 29, 2024
1 parent 65d34a9 commit 8c94033
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/KSXVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ contract KSXVaultAuctionTest is KSXVaultTest {
assertEq(ksxVault.isAuctionReady(), true);
}

/// @notice this test asserts future auctions can
/// still be created at the same time even if the
/// previous auction started late
function test_isAuctionReady_next_week_buffer() public {
uint256 buffer = 1 hours;

vm.warp(DEFAULT_START_TIME + DEFAULT_EPOCH_DURATION);
assertEq(ksxVault.isAuctionReady(), true);

vm.warp(block.timestamp + buffer);
ksxVault.createAuction(STARTING_BID);

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

function test_isAuctionReady_set_one_day() public {
vm.warp(DEFAULT_START_TIME);
assertEq(ksxVault.isAuctionReady(), false);
Expand Down Expand Up @@ -367,6 +385,13 @@ contract KSXVaultAuctionTest is KSXVaultTest {
test_isAuctionReady_next_week();
}

function testFuzzStartTime_isAuctionReady_next_week_buffer(uint128 startTime)
public
{
fuzzStartTime(startTime);
test_isAuctionReady_next_week_buffer();
}

function testFuzzStartTime_isAuctionReady_set_one_day(uint128 startTime)
public
{
Expand Down

0 comments on commit 8c94033

Please sign in to comment.