mirror of
				https://github.com/Instadapp/aave-protocol-v2.git
				synced 2024-07-29 21:47:30 +00:00 
			
		
		
		
	Slight fixes for tests to run and removed old gas tracker
This commit is contained in:
		
							parent
							
								
									4080bb5983
								
							
						
					
					
						commit
						0652b09ffd
					
				| 
						 | 
				
			
			@ -1,10 +0,0 @@
 | 
			
		|||
/**
 | 
			
		||||
 * @dev This is a simple script that keeps track of gas spent during deployment.
 | 
			
		||||
 */
 | 
			
		||||
import { BigNumber } from 'ethers'; 
 | 
			
		||||
 | 
			
		||||
export var totalGas:BigNumber = BigNumber.from(0);
 | 
			
		||||
 | 
			
		||||
export function addGas(amount: BigNumber) {
 | 
			
		||||
    totalGas = totalGas.add(amount);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +20,6 @@ import { formatEther, isAddress, parseEther } from 'ethers/lib/utils';
 | 
			
		|||
import { isZeroAddress } from 'ethereumjs-util';
 | 
			
		||||
import { Signer, BigNumber } from 'ethers';
 | 
			
		||||
import { parse } from 'path';
 | 
			
		||||
import { addGas } from '../../helpers/gas-tracker';
 | 
			
		||||
//import BigNumber from 'bignumber.js';
 | 
			
		||||
 | 
			
		||||
task(
 | 
			
		||||
| 
						 | 
				
			
			@ -95,10 +94,6 @@ task(
 | 
			
		|||
 | 
			
		||||
    // 4. Set pool admins
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    addGas(await addressesProvider.estimateGas.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
 | 
			
		||||
    addGas(await addressesProvider.estimateGas.setEmergencyAdmin(await getEmergencyAdmin(poolConfig)));
 | 
			
		||||
 | 
			
		||||
    await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
 | 
			
		||||
    await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig)));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,6 @@ import {
 | 
			
		|||
  getLendingRateOracle,
 | 
			
		||||
  getPairsTokenAggregator,
 | 
			
		||||
} from '../../helpers/contracts-getters';
 | 
			
		||||
import { addGas } from '../../helpers/gas-tracker';
 | 
			
		||||
 | 
			
		||||
task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
 | 
			
		||||
  .addFlag('verify', 'Verify contracts at Etherscan')
 | 
			
		||||
| 
						 | 
				
			
			@ -69,8 +68,6 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
 | 
			
		|||
      }
 | 
			
		||||
      console.log("ORACLES: %s and %s", aaveOracle.address, lendingRateOracle.address);
 | 
			
		||||
      // Register the proxy price provider on the addressesProvider
 | 
			
		||||
      addGas(await addressesProvider.estimateGas.setPriceOracle(aaveOracle.address));
 | 
			
		||||
      addGas(await addressesProvider.estimateGas.setLendingRateOracle(lendingRateOracle.address));
 | 
			
		||||
      await waitForTx(await addressesProvider.setPriceOracle(aaveOracle.address));
 | 
			
		||||
      await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address));
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,6 @@ import {
 | 
			
		|||
  getLendingPoolAddressesProvider,
 | 
			
		||||
} from '../../helpers/contracts-getters';
 | 
			
		||||
import { ZERO_ADDRESS } from '../../helpers/constants';
 | 
			
		||||
import { addGas } from '../../helpers/gas-tracker';
 | 
			
		||||
 | 
			
		||||
task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
 | 
			
		||||
  .addFlag('verify', 'Verify contracts at Etherscan')
 | 
			
		||||
| 
						 | 
				
			
			@ -58,7 +57,6 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
 | 
			
		|||
 | 
			
		||||
      const collateralManager = await deployLendingPoolCollateralManager(verify);
 | 
			
		||||
 | 
			
		||||
      addGas(await addressesProvider.estimateGas.setLendingPoolCollateralManager(collateralManager.address));
 | 
			
		||||
      await waitForTx(
 | 
			
		||||
        await addressesProvider.setLendingPoolCollateralManager(collateralManager.address)
 | 
			
		||||
      );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,6 @@ import { checkVerification } from '../../helpers/etherscan-verification';
 | 
			
		|||
import { ConfigNames } from '../../helpers/configuration';
 | 
			
		||||
import { printContracts } from '../../helpers/misc-utils';
 | 
			
		||||
import { usingTenderly } from '../../helpers/tenderly-utils';
 | 
			
		||||
import {totalGas} from '../../helpers/gas-tracker';
 | 
			
		||||
 | 
			
		||||
task('aave:mainnet', 'Deploy development enviroment')
 | 
			
		||||
  .addFlag('verify', 'Verify contracts at Etherscan')
 | 
			
		||||
| 
						 | 
				
			
			@ -48,5 +47,4 @@ task('aave:mainnet', 'Deploy development enviroment')
 | 
			
		|||
    }
 | 
			
		||||
    console.log('\nFinished migrations');
 | 
			
		||||
    printContracts();
 | 
			
		||||
    console.log("Total gas used:", totalGas.toString());
 | 
			
		||||
  });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,6 @@ import {checkVerification} from '../../helpers/etherscan-verification';
 | 
			
		|||
import {ConfigNames} from '../../helpers/configuration';
 | 
			
		||||
import {EthereumNetworkNames} from '../../helpers/types';
 | 
			
		||||
import {printContracts} from '../../helpers/misc-utils';
 | 
			
		||||
import {totalGas} from '../../helpers/gas-tracker';
 | 
			
		||||
 | 
			
		||||
task('lp:mainnet', 'Deploy development enviroment')
 | 
			
		||||
  .addFlag('verify', 'Verify contracts at Etherscan')
 | 
			
		||||
| 
						 | 
				
			
			@ -24,8 +23,6 @@ task('lp:mainnet', 'Deploy development enviroment')
 | 
			
		|||
      const provider = new DRE.ethers.providers.Web3Provider(DRE.tenderlyRPC as any);
 | 
			
		||||
      DRE.ethers.provider = provider;
 | 
			
		||||
    }
 | 
			
		||||
    // addGas(1);
 | 
			
		||||
    // console.log(totalGas);
 | 
			
		||||
 | 
			
		||||
    console.log('Migration started\n');
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -59,5 +56,4 @@ task('lp:mainnet', 'Deploy development enviroment')
 | 
			
		|||
    }
 | 
			
		||||
    console.log('\nFinished migrations');
 | 
			
		||||
    printContracts();
 | 
			
		||||
    console.log("Total gas used:", totalGas.toString());
 | 
			
		||||
  });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ import { getReservesConfigByPool } from '../../helpers/configuration';
 | 
			
		|||
import { AavePools, iAavePoolAssets, IReserveParams } from '../../helpers/types';
 | 
			
		||||
import { executeStory } from './helpers/scenario-engine';
 | 
			
		||||
 | 
			
		||||
const scenarioFolder = './test/helpers/scenarios/';
 | 
			
		||||
const scenarioFolder = './test-suites/test-aave/helpers/scenarios/';
 | 
			
		||||
 | 
			
		||||
const selectedScenarios: string[] = [];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ import { getReservesConfigByPool } from '../../helpers/configuration';
 | 
			
		|||
import { AavePools, iLpPoolAssets, IReserveParams } from '../../helpers/types';
 | 
			
		||||
import { executeStory } from './helpers/scenario-engine';
 | 
			
		||||
 | 
			
		||||
const scenarioFolder = './test/helpers/scenarios/';
 | 
			
		||||
const scenarioFolder = './test-suites/test-lp/helpers/scenarios/';
 | 
			
		||||
 | 
			
		||||
const selectedScenarios: string[] = [];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user