2020-06-03 10:44:10 +00:00
|
|
|
import {expect} from "chai";
|
2020-06-10 15:01:32 +00:00
|
|
|
import {createRandomAddress} from "../helpers/misc-utils";
|
|
|
|
import {makeSuite, TestEnv} from "./helpers/make-suite";
|
2020-06-12 08:39:42 +00:00
|
|
|
import {ProtocolErrors} from "../helpers/types";
|
2020-06-03 10:44:10 +00:00
|
|
|
|
2020-06-10 15:01:32 +00:00
|
|
|
makeSuite("LendingPoolAddressesProvider", (testEnv: TestEnv) => {
|
2020-06-03 10:44:10 +00:00
|
|
|
it("Test the accessibility of the LendingPoolAddressesProvider", async () => {
|
2020-06-10 15:01:32 +00:00
|
|
|
const {addressesProvider, users} = testEnv;
|
2020-06-03 10:44:10 +00:00
|
|
|
const mockAddress = createRandomAddress();
|
2020-06-12 08:39:42 +00:00
|
|
|
const {INVALID_OWNER_REVERT_MSG} = ProtocolErrors;
|
2020-06-10 15:01:32 +00:00
|
|
|
|
|
|
|
await addressesProvider.transferOwnership(users[1].address);
|
2020-06-03 10:44:10 +00:00
|
|
|
|
|
|
|
for (const contractFunction of [
|
|
|
|
addressesProvider.setFeeProviderImpl,
|
|
|
|
addressesProvider.setLendingPoolImpl,
|
|
|
|
addressesProvider.setLendingPoolConfiguratorImpl,
|
|
|
|
addressesProvider.setLendingPoolLiquidationManager,
|
|
|
|
addressesProvider.setLendingPoolManager,
|
|
|
|
addressesProvider.setPriceOracle,
|
|
|
|
addressesProvider.setLendingRateOracle,
|
|
|
|
]) {
|
|
|
|
await expect(contractFunction(mockAddress)).to.be.revertedWith(
|
|
|
|
INVALID_OWNER_REVERT_MSG
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|