Skip to content

Commit

Permalink
test: remove unneeded logic from integration test setup (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
wadealexc authored and ypatil12 committed Feb 22, 2025
1 parent 5190210 commit ad83ee3
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/test/integration/IntegrationDeployer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
// Set only once in setUp, if FORK_MAINNET env is set
uint forkType;

<<<<<<< HEAD
/// @dev used to configure randomness and default user/asset types
///
/// Tests that want alternate user/asset types can still use this modifier,
Expand All @@ -100,6 +101,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
_;
}

=======
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
constructor() {
address stETH_Holesky = 0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034;
address stETH_Mainnet = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;
Expand Down Expand Up @@ -142,6 +145,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
}
}

<<<<<<< HEAD
/// @dev Used to create shared setup between tests. This method is called
/// when the `rand` modifier is run, before a test starts
function _init() internal virtual {
Expand All @@ -161,6 +165,13 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
/// Deploy EigenLayer locally
function _setUpLocal() public virtual {
console.log("Setting up `%s` integration tests:", "LOCAL".yellow().bold());
=======
/// Deploy EigenLayer locally
function _setUpLocal() public virtual {
console.log("Setting up `%s` integration tests:", "LOCAL".yellow().bold());
// Bypass upgrade tests when running locally
isUpgraded = true;
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))

// Deploy ProxyAdmin
eigenLayerProxyAdmin = new ProxyAdmin();
Expand Down Expand Up @@ -235,11 +246,16 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
allStrats.push(strategy);
allTokens.push(strategy.underlyingToken());
}
<<<<<<< HEAD

=======

>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
// Create time machine and mock beacon chain
BEACON_GENESIS_TIME = GENESIS_TIME_MAINNET;
timeMachine = new TimeMachine();
beaconChain = new BeaconChainMock(eigenPodManager, BEACON_GENESIS_TIME);
<<<<<<< HEAD

// Since we haven't done the slashing upgrade on mainnet yet, upgrade mainnet contracts
// prior to test. `isUpgraded` is true by default, but is set to false in `UpgradeTest.t.sol`
Expand All @@ -248,6 +264,11 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
}
}

=======
}

/// Deploy current implementation contracts and upgrade existing proxies
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
function _upgradeMainnetContracts() public virtual {
cheats.startPrank(address(executorMultisig));

Expand Down Expand Up @@ -494,6 +515,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
_configUserTypes(_userTypes);
}

<<<<<<< HEAD
function _configAssetTypes(uint _assetTypes) internal {
assetTypes = _bitmapToBytes(_assetTypes);
assertTrue(assetTypes.length != 0, "_configRand: no asset types selected");
Expand Down Expand Up @@ -531,6 +553,35 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
}

/// @dev Create a new user without native ETH. See _randUser above for standard usage
=======
/**
<<<<<<< HEAD
* Depending on the forkType, either deploy contracts locally or parse existing contracts
* from network.
*
* Note: for non-LOCAL forktypes, upgrade of contracts will be performed after user initialization.
*/
function _deployOrFetchContracts() internal {
if (forkType == LOCAL) {
_setUpLocal();
// Set Upgraded as local setup deploys most up to date contracts
isUpgraded = true;
} else if (forkType == MAINNET) {
// cheats.selectFork(mainnetForkId);
string memory deploymentInfoPath = "script/configs/mainnet/mainnet-addresses.config.json";
_parseDeployedContracts(deploymentInfoPath);
string memory existingDeploymentParams = "script/configs/mainnet.json";
_parseParamsForIntegrationUpgrade(existingDeploymentParams);

// Unpause to enable deposits and withdrawals for initializing random user state
cheats.prank(eigenLayerPauserReg.unpauser());
strategyManager.unpause(0);

// Add deployed strategies to lstStrats and allStrats
for (uint i; i < deployedStrategyArray.length; i++) {
IStrategy strategy = IStrategy(deployedStrategyArray[i]);

>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
function _randUser_NoETH(
string memory name
) internal returns (User, IStrategy[] memory, uint[] memory) {
Expand Down

0 comments on commit ad83ee3

Please sign in to comment.