aave-protocol-v2/test/atoken-modifiers.spec.ts
2020-09-12 13:18:17 +02:00

34 lines
1.2 KiB
TypeScript

import {expect} from 'chai';
import {makeSuite, TestEnv} from './helpers/make-suite';
import {ProtocolErrors} from '../helpers/types';
makeSuite('AToken: Modifiers', (testEnv: TestEnv) => {
const {CALLER_MUST_BE_LENDING_POOL} = ProtocolErrors;
it('Tries to invoke mint not being the LendingPool', async () => {
const {deployer, aDai} = testEnv;
await expect(aDai.mint(deployer.address, '1', '1')).to.be.revertedWith(CALLER_MUST_BE_LENDING_POOL);
});
it('Tries to invoke burn not being the LendingPool', async () => {
const {deployer, aDai} = testEnv;
await expect(aDai.burn(deployer.address, deployer.address, '1', '1')).to.be.revertedWith(
CALLER_MUST_BE_LENDING_POOL
);
});
it('Tries to invoke transferOnLiquidation not being the LendingPool', async () => {
const {deployer, users, aDai} = testEnv;
await expect(
aDai.transferOnLiquidation(deployer.address, users[0].address, '1')
).to.be.revertedWith(CALLER_MUST_BE_LENDING_POOL);
});
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(
CALLER_MUST_BE_LENDING_POOL
);
});
});