Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neokry committed Dec 13, 2023
1 parent 06afa80 commit bb8a0fa
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/Gov.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,31 @@ contract GovTest is NounsBuilderTest, GovernorTypesV1 {
mock1155.mintBatch(address(governor), _tokenIds, _amounts);
}

function testFail_GovernorCannotSetDelayPastMax() public {
deployMockWithDelay(block.timestamp + 31 days);
function testRevert_GovernorOnlyTokenOwnerCanSetDelay() public {
deployMock();

vm.prank(voter1);
vm.expectRevert(abi.encodeWithSignature("ONLY_TOKEN_OWNER()"));
governor.updateDelayedGovernanceExpirationTimestamp(1 days);
}

function testRevert_GovernorCannotSetDelayPastMax() public {
deployMock();

vm.prank(founder);
vm.expectRevert(abi.encodeWithSignature("INVALID_DELAYED_GOVERNANCE_EXPIRATION()"));
governor.updateDelayedGovernanceExpirationTimestamp(31 days);
}

function testRevert_GovernorCannotSetDelayAfterTokensAreMinted() public {
deployMock();

vm.prank(founder);
auction.unpause();

vm.prank(address(treasury));
vm.expectRevert(abi.encodeWithSignature("CANNOT_DELAY_GOVERNANCE()"));
governor.updateDelayedGovernanceExpirationTimestamp(1 days);
}

function testRevert_GovernorCannotProposeInDelayPeriod() public {
Expand Down

0 comments on commit bb8a0fa

Please sign in to comment.