aave-protocol-v2/test/stable-token.spec.ts

42 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';
2020-08-19 12:23:41 +00:00
import {ProtocolErrors, eContractid} from '../helpers/types';
2020-07-13 08:54:08 +00:00
import {getContract} from '../helpers/contracts-helpers';
import {StableDebtToken} from '../types/StableDebtToken';
makeSuite('Stable debt token tests', (testEnv: TestEnv) => {
const {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 daiStableDebtTokenAddress = (await helpersContract.getReserveTokensAddresses(dai.address))
2020-07-13 08:54:08 +00:00
.stableDebtTokenAddress;
2020-07-13 08:54:08 +00:00
const stableDebtContract = await getContract<StableDebtToken>(
eContractid.StableDebtToken,
daiStableDebtTokenAddress
);
2020-07-13 08:54:08 +00:00
await expect(stableDebtContract.mint(deployer.address, '1', '1')).to.be.revertedWith(
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, dai, helpersContract} = testEnv;
2020-10-12 18:07:17 +00:00
const daiStableDebtTokenAddress = (await helpersContract.getReserveTokensAddresses(dai.address))
2020-07-13 08:54:08 +00:00
.stableDebtTokenAddress;
2020-07-13 08:54:08 +00:00
const stableDebtContract = await getContract<StableDebtToken>(
eContractid.StableDebtToken,
daiStableDebtTokenAddress
);
2020-07-13 08:54:08 +00:00
await expect(stableDebtContract.burn(deployer.address, '1')).to.be.revertedWith(
CALLER_MUST_BE_LENDING_POOL
);
});
});