mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Removed mock swap
This commit is contained in:
parent
fd61ab9018
commit
64df1eeb36
|
@ -86,7 +86,8 @@
|
||||||
},
|
},
|
||||||
"LendingPool": {
|
"LendingPool": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xD9273d497eDBC967F39d419461CfcF382a0A822e"
|
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2",
|
||||||
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
"address": "0x3EE716e38f21e5FC16BFDB773db24D63C637A5d8"
|
"address": "0x3EE716e38f21e5FC16BFDB773db24D63C637A5d8"
|
||||||
|
@ -235,7 +236,7 @@
|
||||||
},
|
},
|
||||||
"WalletBalanceProvider": {
|
"WalletBalanceProvider": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xd4e934C2749CA8C1618659D02E7B28B074bf4df7",
|
"address": "0x93bB79570dFECC052e36E25cE10793A139e75f1b",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -694,17 +695,6 @@
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MockSwapAdapter": {
|
|
||||||
"buidlerevm": {
|
|
||||||
"address": "0x93bB79570dFECC052e36E25cE10793A139e75f1b"
|
|
||||||
},
|
|
||||||
"coverage": {
|
|
||||||
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
|
||||||
},
|
|
||||||
"localhost": {
|
|
||||||
"address": "0x48FAde2E719B770E1783d03466dAEe98b5183538"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"MockFlashRepayAdapter": {
|
"MockFlashRepayAdapter": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10"
|
"address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10"
|
||||||
|
@ -717,19 +707,19 @@
|
||||||
},
|
},
|
||||||
"ReserveLogic": {
|
"ReserveLogic": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xFAe0fd738dAbc8a0426F47437322b6d026A9FD95",
|
"address": "0x63387deC8C4a0F17Cf0C27Ea3476F03F6a45d3AE",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GenericLogic": {
|
"GenericLogic": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x6082731fdAba4761277Fb31299ebC782AD3bCf24",
|
"address": "0x8280D40C9E9F04229D2435EAad6e0011309ce81B",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ValidationLogic": {
|
"ValidationLogic": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x8456161947DFc1fC159A0B26c025cD2b4bba0c3e",
|
"address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,7 +33,6 @@ import {
|
||||||
MintableErc20Factory,
|
MintableErc20Factory,
|
||||||
MockAggregatorFactory,
|
MockAggregatorFactory,
|
||||||
MockFlashLoanReceiverFactory,
|
MockFlashLoanReceiverFactory,
|
||||||
MockSwapAdapterFactory,
|
|
||||||
PriceOracleFactory,
|
PriceOracleFactory,
|
||||||
ReserveLogicFactory,
|
ReserveLogicFactory,
|
||||||
StableDebtTokenFactory,
|
StableDebtTokenFactory,
|
||||||
|
@ -227,9 +226,6 @@ export const deployWalletBalancerProvider = async (
|
||||||
verify
|
verify
|
||||||
);
|
);
|
||||||
|
|
||||||
export const deployMockSwapAdapter = async (addressesProvider: tEthereumAddress) =>
|
|
||||||
await new MockSwapAdapterFactory(await getFirstSigner()).deploy(addressesProvider);
|
|
||||||
|
|
||||||
export const deployAaveProtocolTestHelpers = async (
|
export const deployAaveProtocolTestHelpers = async (
|
||||||
addressesProvider: tEthereumAddress,
|
addressesProvider: tEthereumAddress,
|
||||||
verify?: boolean
|
verify?: boolean
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
LendingRateOracleFactory,
|
LendingRateOracleFactory,
|
||||||
MintableErc20Factory,
|
MintableErc20Factory,
|
||||||
MockFlashLoanReceiverFactory,
|
MockFlashLoanReceiverFactory,
|
||||||
MockSwapAdapterFactory,
|
|
||||||
PriceOracleFactory,
|
PriceOracleFactory,
|
||||||
ReserveLogicFactory,
|
ReserveLogicFactory,
|
||||||
StableDebtTokenFactory,
|
StableDebtTokenFactory,
|
||||||
|
@ -115,13 +114,6 @@ export const getMockFlashLoanReceiver = async (address?: tEthereumAddress) =>
|
||||||
await getFirstSigner()
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMockSwapAdapter = async (address?: tEthereumAddress) =>
|
|
||||||
await MockSwapAdapterFactory.connect(
|
|
||||||
address ||
|
|
||||||
(await getDb().get(`${eContractid.MockSwapAdapter}.${BRE.network.name}`).value()).address,
|
|
||||||
await getFirstSigner()
|
|
||||||
);
|
|
||||||
|
|
||||||
export const getLendingRateOracle = async (address?: tEthereumAddress) =>
|
export const getLendingRateOracle = async (address?: tEthereumAddress) =>
|
||||||
await LendingRateOracleFactory.connect(
|
await LendingRateOracleFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
|
|
|
@ -44,7 +44,6 @@ export enum eContractid {
|
||||||
LendingPoolCollateralManager = 'LendingPoolCollateralManager',
|
LendingPoolCollateralManager = 'LendingPoolCollateralManager',
|
||||||
InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy',
|
InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy',
|
||||||
MockFlashLoanReceiver = 'MockFlashLoanReceiver',
|
MockFlashLoanReceiver = 'MockFlashLoanReceiver',
|
||||||
MockSwapAdapter = 'MockSwapAdapter',
|
|
||||||
WalletBalanceProvider = 'WalletBalanceProvider',
|
WalletBalanceProvider = 'WalletBalanceProvider',
|
||||||
AToken = 'AToken',
|
AToken = 'AToken',
|
||||||
MockAToken = 'MockAToken',
|
MockAToken = 'MockAToken',
|
||||||
|
|
|
@ -17,7 +17,6 @@ import {
|
||||||
deployMockFlashLoanReceiver,
|
deployMockFlashLoanReceiver,
|
||||||
deployWalletBalancerProvider,
|
deployWalletBalancerProvider,
|
||||||
deployAaveProtocolTestHelpers,
|
deployAaveProtocolTestHelpers,
|
||||||
deployMockSwapAdapter,
|
|
||||||
deployLendingRateOracle,
|
deployLendingRateOracle,
|
||||||
} from '../helpers/contracts-deployments';
|
} from '../helpers/contracts-deployments';
|
||||||
import {Signer} from 'ethers';
|
import {Signer} from 'ethers';
|
||||||
|
@ -239,9 +238,6 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
||||||
const mockFlashLoanReceiver = await deployMockFlashLoanReceiver(addressesProvider.address);
|
const mockFlashLoanReceiver = await deployMockFlashLoanReceiver(addressesProvider.address);
|
||||||
await insertContractAddressInDb(eContractid.MockFlashLoanReceiver, mockFlashLoanReceiver.address);
|
await insertContractAddressInDb(eContractid.MockFlashLoanReceiver, mockFlashLoanReceiver.address);
|
||||||
|
|
||||||
const mockSwapAdapter = await deployMockSwapAdapter(addressesProvider.address);
|
|
||||||
await insertContractAddressInDb(eContractid.MockSwapAdapter, mockSwapAdapter.address);
|
|
||||||
|
|
||||||
await deployWalletBalancerProvider(addressesProvider.address);
|
await deployWalletBalancerProvider(addressesProvider.address);
|
||||||
|
|
||||||
console.log('END');
|
console.log('END');
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {
|
||||||
getMintableErc20,
|
getMintableErc20,
|
||||||
getLendingPoolConfiguratorProxy,
|
getLendingPoolConfiguratorProxy,
|
||||||
getPriceOracle,
|
getPriceOracle,
|
||||||
getMockSwapAdapter,
|
|
||||||
getLendingPoolAddressesProviderRegistry,
|
getLendingPoolAddressesProviderRegistry,
|
||||||
} from '../../helpers/contracts-getters';
|
} from '../../helpers/contracts-getters';
|
||||||
import {tEthereumAddress} from '../../helpers/types';
|
import {tEthereumAddress} from '../../helpers/types';
|
||||||
|
@ -24,7 +23,6 @@ import bignumberChai from 'chai-bignumber';
|
||||||
import {almostEqual} from './almost-equal';
|
import {almostEqual} from './almost-equal';
|
||||||
import {PriceOracle} from '../../types/PriceOracle';
|
import {PriceOracle} from '../../types/PriceOracle';
|
||||||
import {LendingPoolAddressesProvider} from '../../types/LendingPoolAddressesProvider';
|
import {LendingPoolAddressesProvider} from '../../types/LendingPoolAddressesProvider';
|
||||||
import {MockSwapAdapter} from '../../types/MockSwapAdapter';
|
|
||||||
import {LendingPoolAddressesProviderRegistry} from '../../types/LendingPoolAddressesProviderRegistry';
|
import {LendingPoolAddressesProviderRegistry} from '../../types/LendingPoolAddressesProviderRegistry';
|
||||||
import {getEthersSigners} from '../../helpers/contracts-helpers';
|
import {getEthersSigners} from '../../helpers/contracts-helpers';
|
||||||
chai.use(bignumberChai());
|
chai.use(bignumberChai());
|
||||||
|
@ -48,7 +46,6 @@ export interface TestEnv {
|
||||||
usdc: MintableERC20;
|
usdc: MintableERC20;
|
||||||
lend: MintableERC20;
|
lend: MintableERC20;
|
||||||
addressesProvider: LendingPoolAddressesProvider;
|
addressesProvider: LendingPoolAddressesProvider;
|
||||||
mockSwapAdapter: MockSwapAdapter;
|
|
||||||
registry: LendingPoolAddressesProviderRegistry;
|
registry: LendingPoolAddressesProviderRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +70,6 @@ const testEnv: TestEnv = {
|
||||||
usdc: {} as MintableERC20,
|
usdc: {} as MintableERC20,
|
||||||
lend: {} as MintableERC20,
|
lend: {} as MintableERC20,
|
||||||
addressesProvider: {} as LendingPoolAddressesProvider,
|
addressesProvider: {} as LendingPoolAddressesProvider,
|
||||||
mockSwapAdapter: {} as MockSwapAdapter,
|
|
||||||
registry: {} as LendingPoolAddressesProviderRegistry,
|
registry: {} as LendingPoolAddressesProviderRegistry,
|
||||||
} as TestEnv;
|
} as TestEnv;
|
||||||
|
|
||||||
|
@ -132,8 +128,6 @@ export async function initializeMakeSuite() {
|
||||||
testEnv.usdc = await getMintableErc20(usdcAddress);
|
testEnv.usdc = await getMintableErc20(usdcAddress);
|
||||||
testEnv.lend = await getMintableErc20(lendAddress);
|
testEnv.lend = await getMintableErc20(lendAddress);
|
||||||
testEnv.weth = await getMintableErc20(wethAddress);
|
testEnv.weth = await getMintableErc20(wethAddress);
|
||||||
|
|
||||||
testEnv.mockSwapAdapter = await getMockSwapAdapter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makeSuite(name: string, tests: (testEnv: TestEnv) => void) {
|
export function makeSuite(name: string, tests: (testEnv: TestEnv) => void) {
|
||||||
|
|
|
@ -276,7 +276,7 @@ makeSuite('Pausable Pool', (testEnv: TestEnv) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('SwapBorrowRateMode', async () => {
|
it('SwapBorrowRateMode', async () => {
|
||||||
const {pool, weth, dai, usdc, users, configurator, mockSwapAdapter} = testEnv;
|
const {pool, weth, dai, usdc, users, configurator} = testEnv;
|
||||||
const user = users[1];
|
const user = users[1];
|
||||||
const amountWETHToDeposit = parseEther('10');
|
const amountWETHToDeposit = parseEther('10');
|
||||||
const amountDAIToDeposit = parseEther('120');
|
const amountDAIToDeposit = parseEther('120');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user