Skip to content

Commit

Permalink
Add more tests to confirm non-owner cannot remove hat from whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Nov 6, 2024
1 parent e6e0bd1 commit f0d0acd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ describe('LinearERC20VotingWithHatsProposalCreation', () => {
);
});

it('Non-owner cannot remove a hat from the whitelist', async () => {
const hatId = 1; // Example hat ID

await expect(
linearERC20VotingWithHats.connect(rando).removeHatFromWhitelist(hatId),
).to.be.revertedWith('Ownable: caller is not the owner');
});

it('Cannot call setUp function again', async () => {
const setupParams = ethers.AbiCoder.defaultAbiCoder().encode(
['address', 'address', 'address', 'uint32', 'uint256', 'uint256', 'address', 'uint256[]'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ describe('LinearERC721VotingWithHatsProposalCreation', () => {
);
});

it('Non-owner cannot remove a hat from the whitelist', async () => {
const hatId = 1; // Example hat ID

await expect(
linearERC721VotingWithHats.connect(rando).removeHatFromWhitelist(hatId),
).to.be.revertedWith('Ownable: caller is not the owner');
});

it('Cannot call setUp function again', async () => {
const setupParams = ethers.AbiCoder.defaultAbiCoder().encode(
[
Expand Down

0 comments on commit f0d0acd

Please sign in to comment.