From 9a269a713d09adbc247887afd2d40419aabcf386 Mon Sep 17 00:00:00 2001 From: franz Date: Thu, 12 Dec 2024 17:55:37 +0100 Subject: [PATCH] test increment year errors --- test/BeetsTest.t.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/BeetsTest.t.sol b/test/BeetsTest.t.sol index efe6476..9459faa 100644 --- a/test/BeetsTest.t.sol +++ b/test/BeetsTest.t.sol @@ -35,6 +35,7 @@ contract BeetsTest is Test { assertEq(beetsToken.amountMintedCurrentYear(), 0); assertEq(beetsToken.getMaxAllowedSupplyCurrentYear(), 220_000_000 ether); assertEq(beetsToken.balanceOf(TOKEN_MINTER_TARGET), INITIAL_SUPPLY); + assertEq(beetsToken.getEndTimestampCurrentYear(), block.timestamp + 365 days); } function testConstructorErrorZeroSupply() public { @@ -150,4 +151,17 @@ contract BeetsTest is Test { assertEq(beetsToken.amountMintedCurrentYear(), 0); assertEq(beetsToken.startingSupplyCurrentYear(), INITIAL_SUPPLY); } + + function testIncrementYearNotEndedError() public { + vm.warp(block.timestamp + 364 days); + + vm.prank(TOKEN_MINTER_ADDRESS); + vm.expectRevert(abi.encodeWithSelector(Beets.CurrentYearHasNotEnded.selector)); + beetsToken.incrementYear(); + } + + function testIncrementYearUnauthorized() public { + vm.expectRevert(abi.encodeWithSelector(OwnableUnauthorizedAccount.selector, address(this))); + beetsToken.incrementYear(); + } }