aave-protocol-v2/test/variable-debt-token.spec.ts

37 lines
1.4 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, TokenContractId, eContractid} from '../helpers/types';
2020-10-30 12:40:06 +00:00
import {getVariableDebtToken} from '../helpers/contracts-getters';
2020-07-13 08:54:08 +00:00
makeSuite('Variable debt token tests', (testEnv: TestEnv) => {
const {AT_CALLER_MUST_BE_LENDING_POOL} = ProtocolErrors;
2020-07-13 08:54:08 +00:00
it('Tries to invoke mint not being the LendingPool', async () => {
2020-10-12 18:07:17 +00:00
const {deployer, pool, dai, helpersContract} = testEnv;
2020-10-12 18:07:17 +00:00
const daiVariableDebtTokenAddress = (
await helpersContract.getReserveTokensAddresses(dai.address)
).variableDebtTokenAddress;
2020-10-30 12:40:06 +00:00
const variableDebtContract = await getVariableDebtToken(daiVariableDebtTokenAddress);
2020-11-03 18:47:57 +00:00
await expect(
variableDebtContract.mint(deployer.address, deployer.address, '1', '1')
).to.be.revertedWith(AT_CALLER_MUST_BE_LENDING_POOL);
});
2020-07-13 08:54:08 +00:00
it('Tries to invoke burn not being the LendingPool', async () => {
2020-10-12 18:07:17 +00:00
const {deployer, pool, dai, helpersContract} = testEnv;
2020-10-12 18:07:17 +00:00
const daiVariableDebtTokenAddress = (
await helpersContract.getReserveTokensAddresses(dai.address)
).variableDebtTokenAddress;
2020-10-30 12:40:06 +00:00
const variableDebtContract = await getVariableDebtToken(daiVariableDebtTokenAddress);
2020-09-14 13:09:16 +00:00
await expect(variableDebtContract.burn(deployer.address, '1', '1')).to.be.revertedWith(
AT_CALLER_MUST_BE_LENDING_POOL
);
});
});