aave-protocol-v2/test/lending-pool-addresses-provider.spec.ts
eboado 99cbb5f0a4 - Fixed typo on configurator.spec test name.
- Unified error messages for tests on types.ts.
- Finished migration of core-modifiers.spec.ts.
2020-06-12 10:39:42 +02:00

32 lines
1.2 KiB
TypeScript

import {expect} from "chai";
import {createRandomAddress} from "../helpers/misc-utils";
import {makeSuite, TestEnv} from "./helpers/make-suite";
import {ProtocolErrors} from "../helpers/types";
makeSuite("LendingPoolAddressesProvider", (testEnv: TestEnv) => {
it("Test the accessibility of the LendingPoolAddressesProvider", async () => {
const {addressesProvider, users} = testEnv;
const mockAddress = createRandomAddress();
const {INVALID_OWNER_REVERT_MSG} = ProtocolErrors;
await addressesProvider.transferOwnership(users[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
);
}
});
});