aave-protocol-v2/test/atoken-modifiers.spec.ts

36 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-07-13 08:54:08 +00:00
import {expect} from 'chai';
import {makeSuite, TestEnv} from './helpers/make-suite';
import {ProtocolErrors} from '../helpers/types';
2020-07-13 08:54:08 +00:00
makeSuite('AToken: Modifiers', (testEnv: TestEnv) => {
const {INVALID_POOL_CALLER_MSG_1} = ProtocolErrors;
2020-07-13 08:54:08 +00:00
it('Tries to invoke mintOnDeposit not being the LendingPool', async () => {
const {deployer, aDai} = testEnv;
2020-07-13 08:54:08 +00:00
await expect(aDai.mintOnDeposit(deployer.address, '1')).to.be.revertedWith(
INVALID_POOL_CALLER_MSG_1
);
2020-06-08 15:36:40 +00:00
});
2020-07-13 08:54:08 +00:00
it('Tries to invoke burnOnLiquidation not being the LendingPool', async () => {
const {deployer, aDai} = testEnv;
2020-07-13 08:54:08 +00:00
await expect(aDai.burnOnLiquidation(deployer.address, '1')).to.be.revertedWith(
INVALID_POOL_CALLER_MSG_1
);
});
2020-06-08 15:36:40 +00:00
2020-07-13 08:54:08 +00:00
it('Tries to invoke transferOnLiquidation not being the LendingPool', async () => {
const {deployer, users, aDai} = testEnv;
await expect(
2020-07-13 08:54:08 +00:00
aDai.transferOnLiquidation(deployer.address, users[0].address, '1')
).to.be.revertedWith(INVALID_POOL_CALLER_MSG_1);
});
2020-07-13 14:43:26 +00:00
it('Tries to invoke transferUnderlyingTo not being the LendingPool', async () => {
const {deployer, users, aDai} = testEnv;
await expect(aDai.transferUnderlyingTo(deployer.address, '1')).to.be.revertedWith(
INVALID_POOL_CALLER_MSG_1
);
});
2020-06-08 15:36:40 +00:00
});