mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix: Update paths for tests
This commit is contained in:
parent
209bd6b2de
commit
70e49ba127
|
@ -12,7 +12,7 @@ import {
|
|||
WETH9,
|
||||
AToken,
|
||||
StaticATokenLM,
|
||||
} from '../../../types';
|
||||
} from '../../../../types';
|
||||
import {
|
||||
impersonateAccountsHardhat,
|
||||
DRE,
|
||||
|
@ -21,17 +21,15 @@ import {
|
|||
evmSnapshot,
|
||||
timeLatest,
|
||||
advanceTimeAndBlock,
|
||||
} from '../../../helpers/misc-utils';
|
||||
} from '../../../../helpers/misc-utils';
|
||||
import { BigNumber, providers, Signer, utils } from 'ethers';
|
||||
import { MAX_UINT_AMOUNT } from '../../../helpers/constants';
|
||||
import { tEthereumAddress } from '../../../helpers/types';
|
||||
import { MAX_UINT_AMOUNT } from '../../../../helpers/constants';
|
||||
import { AbiCoder, formatEther, verifyTypedData } from 'ethers/lib/utils';
|
||||
|
||||
import { _TypedDataEncoder } from 'ethers/lib/utils';
|
||||
|
||||
import { expect, use } from 'chai';
|
||||
import { stat } from 'fs';
|
||||
import { getCurrentBlock } from '../../../helpers/contracts-helpers';
|
||||
import { getCurrentBlock } from '../../../../helpers/contracts-helpers';
|
||||
|
||||
//use(solidity);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
AToken,
|
||||
StaticAToken,
|
||||
StaticATokenLM,
|
||||
} from '../../../types';
|
||||
} from '../../../../types';
|
||||
import {
|
||||
impersonateAccountsHardhat,
|
||||
DRE,
|
||||
|
@ -23,11 +23,11 @@ import {
|
|||
evmSnapshot,
|
||||
timeLatest,
|
||||
advanceTimeAndBlock,
|
||||
} from '../../../helpers/misc-utils';
|
||||
} from '../../../../helpers/misc-utils';
|
||||
import { BigNumber, providers, Signer, utils } from 'ethers';
|
||||
import { rayMul } from '../../../helpers/ray-math';
|
||||
import { MAX_UINT_AMOUNT, ZERO_ADDRESS } from '../../../helpers/constants';
|
||||
import { tEthereumAddress } from '../../../helpers/types';
|
||||
import { rayMul } from '../../../../helpers/ray-math';
|
||||
import { MAX_UINT_AMOUNT, ZERO_ADDRESS } from '../../../../helpers/constants';
|
||||
import { tEthereumAddress } from '../../../../helpers/types';
|
||||
import { AbiCoder, formatEther, verifyTypedData } from 'ethers/lib/utils';
|
||||
import { stat } from 'fs';
|
||||
|
||||
|
@ -37,7 +37,7 @@ import {
|
|||
buildMetaWithdrawParams,
|
||||
buildPermitParams,
|
||||
getSignatureFromTypedData,
|
||||
} from '../../../helpers/contracts-helpers';
|
||||
} from '../../../../helpers/contracts-helpers';
|
||||
import { TypedDataUtils, typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util';
|
||||
import { zeroAddress } from 'ethereumjs-util';
|
||||
|
||||
|
@ -398,7 +398,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini
|
|||
await staticAToken.deposit(userSigner._address, amountToDeposit, 0, true, defaultTxParams)
|
||||
);
|
||||
|
||||
const ownerPrivateKey = require('../../../test-wallets.js').accounts[0].secretKey;
|
||||
const ownerPrivateKey = require('../../../../test-wallets.js').accounts[0].secretKey;
|
||||
if (!ownerPrivateKey) {
|
||||
throw new Error('INVALID_OWNER_PK');
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini
|
|||
await staticAToken.deposit(userSigner._address, amountToDeposit, 0, true, defaultTxParams)
|
||||
);
|
||||
|
||||
const ownerPrivateKey = require('../../../test-wallets.js').accounts[0].secretKey;
|
||||
const ownerPrivateKey = require('../../../../test-wallets.js').accounts[0].secretKey;
|
||||
if (!ownerPrivateKey) {
|
||||
throw new Error('INVALID_OWNER_PK');
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini
|
|||
const seperator = await staticAToken.getDomainSeparator(chainId);
|
||||
expect(seperator).to.be.eq(domainSeperator);
|
||||
|
||||
const userPrivateKey = require('../../../test-wallets.js').accounts[0].secretKey;
|
||||
const userPrivateKey = require('../../../../test-wallets.js').accounts[0].secretKey;
|
||||
if (!userPrivateKey) {
|
||||
throw new Error('INVALID_OWNER_PK');
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini
|
|||
const seperator = await staticAToken.getDomainSeparator(chainId);
|
||||
expect(seperator).to.be.eq(domainSeperator);
|
||||
|
||||
const userPrivateKey = require('../../../test-wallets.js').accounts[0].secretKey;
|
||||
const userPrivateKey = require('../../../../test-wallets.js').accounts[0].secretKey;
|
||||
if (!userPrivateKey) {
|
||||
throw new Error('INVALID_OWNER_PK');
|
||||
}
|
||||
|
@ -811,7 +811,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini
|
|||
const seperator = await staticAToken.getDomainSeparator(chainId);
|
||||
expect(seperator).to.be.eq(domainSeperator);
|
||||
|
||||
const userPrivateKey = require('../../../test-wallets.js').accounts[0].secretKey;
|
||||
const userPrivateKey = require('../../../../test-wallets.js').accounts[0].secretKey;
|
||||
if (!userPrivateKey) {
|
||||
throw new Error('INVALID_OWNER_PK');
|
||||
}
|
||||
|
|
|
@ -12,19 +12,16 @@ import {
|
|||
AToken,
|
||||
WETH9,
|
||||
ERC20Factory,
|
||||
} from '../../types';
|
||||
} from '../../../types';
|
||||
import {
|
||||
impersonateAccountsHardhat,
|
||||
DRE,
|
||||
waitForTx,
|
||||
advanceTimeAndBlock,
|
||||
} from '../../helpers/misc-utils';
|
||||
} from '../../../helpers/misc-utils';
|
||||
import { utils } from 'ethers';
|
||||
import { rayMul } from '../../helpers/ray-math';
|
||||
import { MAX_UINT_AMOUNT } from '../../helpers/constants';
|
||||
import { tEthereumAddress } from '../../helpers/types';
|
||||
import { MAX_UINT_AMOUNT } from '../../../helpers/constants';
|
||||
import { formatEther, parseEther } from 'ethers/lib/utils';
|
||||
import { mint } from '../helpers/actions';
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
|
@ -157,7 +154,7 @@ describe('Attack', () => {
|
|||
console.log(`Total supply vamToken: ${formatEther(await vamToken.totalSupply())}`);
|
||||
|
||||
// Step 4, Alice withdraws and claims
|
||||
console.log('Step 4. Alice Withdraws');
|
||||
console.log('Step 4. Alice Withdraws and claim');
|
||||
const aliceBalance = await vamToken.balanceOf(userSigner._address);
|
||||
await waitForTx(await vamToken.connect(userSigner).burn(aliceBalance));
|
||||
|
||||
|
@ -169,7 +166,7 @@ describe('Attack', () => {
|
|||
);
|
||||
|
||||
// Bob also withdraws
|
||||
console.log(`Bob also withdraws`);
|
||||
console.log(`Step 5. Bob withdraws and claims`);
|
||||
const bobBalance = await vamToken.balanceOf(attackerSigner._address);
|
||||
await waitForTx(await vamToken.connect(attackerSigner).burn(bobBalance));
|
||||
await waitForTx(await vamToken.connect(userSigner).claimRewards(userSigner._address, STKAAVE));
|
||||
|
|
Loading…
Reference in New Issue
Block a user