Skip to content

Commit

Permalink
test increment year errors
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns committed Dec 12, 2024
1 parent 12fc2bd commit 9a269a7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/BeetsTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
}

0 comments on commit 9a269a7

Please sign in to comment.