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) => {
2020-09-04 08:27:32 +00:00
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 () => {
const {deployer, pool, dai} = testEnv;
2020-07-13 08:54:08 +00:00
const daiStableDebtTokenAddress = (await pool.getReserveTokensAddresses(dai.address))
.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(
2020-09-04 08:27:32 +00:00
CALLER_MUST_BE_LENDING_POOL
);
});
2020-07-13 08:54:08 +00:00
it('Tries to invoke burn not being the LendingPool', async () => {
const {deployer, pool, dai} = testEnv;
2020-07-13 08:54:08 +00:00
const daiStableDebtTokenAddress = (await pool.getReserveTokensAddresses(dai.address))
.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(
2020-09-04 08:27:32 +00:00
CALLER_MUST_BE_LENDING_POOL
);
});
});