2020-06-08 12:03:40 +00:00
|
|
|
import {expect} from "chai";
|
2020-06-10 15:01:32 +00:00
|
|
|
import {makeSuite, TestEnv} from "./helpers/make-suite";
|
2020-06-12 08:39:42 +00:00
|
|
|
import {ProtocolErrors} from "../helpers/types";
|
2020-06-08 12:03:40 +00:00
|
|
|
|
2020-06-10 15:01:32 +00:00
|
|
|
makeSuite("AToken: Modifiers", (testEnv: TestEnv) => {
|
2020-06-12 08:39:42 +00:00
|
|
|
const {INVALID_POOL_CALLER_MSG_1} = ProtocolErrors;
|
2020-06-08 12:03:40 +00:00
|
|
|
|
2020-06-08 19:06:26 +00:00
|
|
|
it("Tries to invoke mintOnDeposit not being the LendingPool", async () => {
|
2020-06-12 07:41:30 +00:00
|
|
|
const {deployer, aDai} = testEnv;
|
|
|
|
await expect(aDai.mintOnDeposit(deployer.address, "1")).to.be.revertedWith(
|
2020-06-12 08:39:42 +00:00
|
|
|
INVALID_POOL_CALLER_MSG_1
|
2020-06-08 19:06:26 +00:00
|
|
|
);
|
2020-06-08 15:36:40 +00:00
|
|
|
});
|
2020-06-08 12:03:40 +00:00
|
|
|
|
2020-06-08 19:06:26 +00:00
|
|
|
it("Tries to invoke burnOnLiquidation not being the LendingPool", async () => {
|
2020-06-12 07:41:30 +00:00
|
|
|
const {deployer, aDai} = testEnv;
|
2020-06-08 19:06:26 +00:00
|
|
|
await expect(
|
2020-06-12 07:41:30 +00:00
|
|
|
aDai.burnOnLiquidation(deployer.address, "1")
|
2020-06-12 08:39:42 +00:00
|
|
|
).to.be.revertedWith(INVALID_POOL_CALLER_MSG_1);
|
2020-06-08 19:06:26 +00:00
|
|
|
});
|
2020-06-08 15:36:40 +00:00
|
|
|
|
2020-06-08 19:06:26 +00:00
|
|
|
it("Tries to invoke transferOnLiquidation not being the LendingPool", async () => {
|
2020-06-12 07:41:30 +00:00
|
|
|
const {deployer, users, aDai} = testEnv;
|
2020-06-08 19:06:26 +00:00
|
|
|
await expect(
|
2020-06-12 07:41:30 +00:00
|
|
|
aDai.transferOnLiquidation(deployer.address, users[0].address, "1")
|
2020-06-12 08:39:42 +00:00
|
|
|
).to.be.revertedWith(INVALID_POOL_CALLER_MSG_1);
|
2020-06-08 19:06:26 +00:00
|
|
|
});
|
2020-06-08 15:36:40 +00:00
|
|
|
});
|