Skip to content

Commit

Permalink
test: fixed broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Aug 30, 2023
1 parent 8c3f223 commit 11a3b00
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/contracts/test/core/dao/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ describe('DAO', function () {
ownerAddress,
PERMISSION_IDS.UPGRADE_DAO_PERMISSION_ID
),
dao.grant(
dao.address,
ownerAddress,
PERMISSION_IDS.VALIDATE_SIGNATURE_PERMISSION_ID
),
dao.grant(
dao.address,
ownerAddress,
Expand Down Expand Up @@ -1230,17 +1225,18 @@ describe('DAO', function () {
).to.be.eq(true);
});

it('reverts all signatures requests by default', async () => {
it('treats signatures as invalid by default if no permission is set', async () => {
const caller = signers[0];
const signer = signers[1];

const message = 'Hi!';
const hash = ethers.utils.hashMessage(message);
const signature = await signer.signMessage(message);

// The caller can validate signatures now.
expect(await dao.connect(caller).isValidSignature(hash, signature)).to.be
.reverted;
// Because no permission is set, the signature is said to be invalid
expect(
await dao.connect(caller).isValidSignature(hash, signature)
).to.equal(INVALID_ERC1271_SIGNATURE);
});

it('allows caller specific signature validation', async () => {
Expand Down

0 comments on commit 11a3b00

Please sign in to comment.