diff --git a/test/KSXVault.t.sol b/test/KSXVault.t.sol index 384a678..8deab8f 100644 --- a/test/KSXVault.t.sol +++ b/test/KSXVault.t.sol @@ -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); @@ -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 {