Skip to content

Commit 16776c2

Browse files
committed
fix(test-suite): use revertedWithCustomError for non-owner assertion
Add NotHostOwner error to HCU_LIMIT_ABI and assert the specific custom error instead of generic revert.
1 parent 5ae0794 commit 16776c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test-suite/e2e/test/encryptedERC20/EncryptedERC20.HCU.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const HCU_LIMIT_ABI = [
1919
'function addToBlockHCUWhitelist(address)',
2020
'function removeFromBlockHCUWhitelist(address)',
2121
'function isBlockHCUWhitelisted(address) view returns (bool)',
22+
'error NotHostOwner()',
2223
];
2324

2425
describe('EncryptedERC20:HCU', function () {
@@ -296,7 +297,10 @@ describe('EncryptedERC20:HCU', function () {
296297

297298
it('should reject setHCUPerBlock from non-owner', async function () {
298299
const aliceHcuLimit = this.hcuLimit.connect(this.signers.alice);
299-
await expect(aliceHcuLimit.setHCUPerBlock(1_000_000)).to.be.reverted;
300+
await expect(aliceHcuLimit.setHCUPerBlock(1_000_000)).to.be.revertedWithCustomError(
301+
this.hcuLimit,
302+
'NotHostOwner',
303+
);
300304
});
301305
});
302306
});

0 commit comments

Comments
 (0)