mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix snapshots
This commit is contained in:
parent
070b46552a
commit
268dcdead8
|
@ -33,7 +33,6 @@ import {
|
|||
getEthersSigners,
|
||||
} from "../helpers/contracts-helpers";
|
||||
import {LendingPoolAddressesProvider} from "../types/LendingPoolAddressesProvider";
|
||||
import {evmSnapshot} from "../helpers/misc-utils";
|
||||
import {Wallet, ContractTransaction, ethers, Signer} from "ethers";
|
||||
import {
|
||||
TokenContractId,
|
||||
|
@ -621,8 +620,6 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
|||
testHelpers.address
|
||||
);
|
||||
|
||||
await evmSnapshot();
|
||||
|
||||
console.timeEnd("setup");
|
||||
};
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@ import {
|
|||
import {evmRevert} from "../helpers/misc-utils";
|
||||
import {AToken} from "../types/AToken";
|
||||
import {TEST_SNAPSHOT_ID} from "../helpers/constants";
|
||||
import { makeSuite } from './helpers/make-suite';
|
||||
|
||||
describe("AToken: Modifiers", () => {
|
||||
makeSuite("AToken: Modifiers", () => {
|
||||
const [deployer, ...restWallets] = new MockProvider().getWallets();
|
||||
let _aDAI = {} as AToken;
|
||||
const NOT_LENDING_POOL_MSG =
|
||||
"The caller of this function must be a lending pool";
|
||||
|
||||
before(async () => {
|
||||
await evmRevert(TEST_SNAPSHOT_ID);
|
||||
const testHelpers = await getAaveProtocolTestHelpers();
|
||||
|
||||
const aDAIAddress = (await testHelpers.getAllATokens()).find(
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import {evmRevert} from "../helpers/misc-utils";
|
||||
import {
|
||||
TEST_SNAPSHOT_ID,
|
||||
APPROVAL_AMOUNT_LENDING_POOL_CORE,
|
||||
MOCK_ETH_ADDRESS,
|
||||
AAVE_REFERRAL,
|
||||
|
@ -23,8 +21,11 @@ import {
|
|||
import {expect} from "chai";
|
||||
import {Signer, ethers} from "ethers";
|
||||
import {RateMode} from "../helpers/types";
|
||||
import { makeSuite } from './helpers/make-suite';
|
||||
|
||||
describe("AToken: Transfer", () => {
|
||||
|
||||
|
||||
makeSuite("AToken: Transfer", () => {
|
||||
let deployer: Signer;
|
||||
let users: Signer[];
|
||||
let _aDai: AToken;
|
||||
|
@ -33,8 +34,6 @@ describe("AToken: Transfer", () => {
|
|||
let _lendingPoolCore: LendingPoolCore;
|
||||
|
||||
before(async () => {
|
||||
await evmRevert(TEST_SNAPSHOT_ID);
|
||||
|
||||
const [_deployer, ..._users] = await getEthersSigners();
|
||||
deployer = _deployer;
|
||||
users = _users;
|
||||
|
|
14
test/helpers/make-suite.ts
Normal file
14
test/helpers/make-suite.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { evmRevert, evmSnapshot } from '../../helpers/misc-utils';
|
||||
import { TEST_SNAPSHOT_ID } from '../../helpers/constants';
|
||||
|
||||
export function makeSuite(name: string, tests: () => void) {
|
||||
describe(name, function () {
|
||||
before(async () => {
|
||||
await evmSnapshot();
|
||||
});
|
||||
tests();
|
||||
after(async () => {
|
||||
await evmRevert(TEST_SNAPSHOT_ID);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -3,14 +3,11 @@ import {MockProvider} from "ethereum-waffle";
|
|||
import {getLendingPoolAddressesProvider} from "../helpers/contracts-helpers";
|
||||
import {createRandomAddress, evmRevert} from "../helpers/misc-utils";
|
||||
import {TEST_SNAPSHOT_ID} from "../helpers/constants";
|
||||
import { makeSuite } from './helpers/make-suite';
|
||||
|
||||
describe("LendingPoolAddressesProvider", () => {
|
||||
makeSuite("LendingPoolAddressesProvider", () => {
|
||||
const wallets = new MockProvider().getWallets();
|
||||
|
||||
before(async () => {
|
||||
await evmRevert(TEST_SNAPSHOT_ID);
|
||||
});
|
||||
|
||||
it("Test the accessibility of the LendingPoolAddressesProvider", async () => {
|
||||
const mockAddress = createRandomAddress();
|
||||
const INVALID_OWNER_REVERT_MSG = "Ownable: caller is not the owner";
|
||||
|
|
Loading…
Reference in New Issue
Block a user