Skip to content

Commit

Permalink
fix: Add tests for ASSET_LISTING_ADMIN role
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Sep 22, 2021
1 parent 3c3cd50 commit 84aa268
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test-suites/acl-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ makeSuite('Access Control List Manager', (testEnv: TestEnv) => {
expect(await aclManager.isRiskAdmin(riskAdmin.address)).to.be.eq(true);
});

it('Grant ASSET_LISTING_ADMIN role', async () => {
const {
deployer,
users: [, , , , , assetListingAdmin],
} = testEnv;

expect(await aclManager.isAssetListingAdmin(assetListingAdmin.address)).to.be.eq(false);
await aclManager.connect(deployer.signer).addAssetListingAdmin(assetListingAdmin.address);
expect(await aclManager.isAssetListingAdmin(assetListingAdmin.address)).to.be.eq(true);
});

it('Revoke FLASH_BORROWER', async () => {
const {
users: [flashBorrowAdmin, flashBorrower],
Expand Down Expand Up @@ -239,6 +250,17 @@ makeSuite('Access Control List Manager', (testEnv: TestEnv) => {
expect(await aclManager.isRiskAdmin(riskAdmin.address)).to.be.eq(false);
});

it('Revoke ASSET_LISTING_ADMIN', async () => {
const {
deployer,
users: [, , , , , assetListingAdmin],
} = testEnv;

expect(await aclManager.isAssetListingAdmin(assetListingAdmin.address)).to.be.eq(true);
await aclManager.connect(deployer.signer).removeAssetListingAdmin(assetListingAdmin.address);
expect(await aclManager.isAssetListingAdmin(assetListingAdmin.address)).to.be.eq(false);
});

it('Tries to deploy ACLManager when ACLAdmin is ZERO_ADDRESS (revert expected)', async () => {
const { deployer, addressesProvider } = testEnv;

Expand Down

0 comments on commit 84aa268

Please sign in to comment.