mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
0453a49f8f
- Migrated atoken-modifiers tests.
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import {expect} from "chai";
|
|
import {MockProvider} from "ethereum-waffle";
|
|
import {getLendingPoolAddressesProvider} from "../helpers/contracts-helpers";
|
|
import {createRandomAddress, evmRevert} from "../helpers/misc-utils";
|
|
import {TEST_SNAPSHOT_ID} from "../helpers/constants";
|
|
|
|
describe("LendingPoolAddressesProvider", () => {
|
|
const wallets = new MockProvider().getWallets();
|
|
|
|
before(async () => {
|
|
await evmRevert(TEST_SNAPSHOT_ID);
|
|
});
|
|
|
|
it("Test the accessibility of the LendingPoolAddressesProvider", async () => {
|
|
const mockAddress = createRandomAddress();
|
|
const INVALID_OWNER_REVERT_MSG = "Ownable: caller is not the owner";
|
|
const addressesProvider = await getLendingPoolAddressesProvider();
|
|
await addressesProvider.transferOwnership(wallets[1].address);
|
|
|
|
for (const contractFunction of [
|
|
addressesProvider.setFeeProviderImpl,
|
|
addressesProvider.setLendingPoolImpl,
|
|
addressesProvider.setLendingPoolConfiguratorImpl,
|
|
addressesProvider.setLendingPoolCoreImpl,
|
|
addressesProvider.setLendingPoolDataProviderImpl,
|
|
addressesProvider.setLendingPoolLiquidationManager,
|
|
addressesProvider.setLendingPoolManager,
|
|
addressesProvider.setLendingPoolParametersProviderImpl,
|
|
addressesProvider.setPriceOracle,
|
|
addressesProvider.setLendingRateOracle,
|
|
]) {
|
|
await expect(contractFunction(mockAddress)).to.be.revertedWith(
|
|
INVALID_OWNER_REVERT_MSG
|
|
);
|
|
}
|
|
});
|
|
});
|