Skip to content

Commit ad83ee3

Browse files
wadealexcypatil12
authored andcommitted
test: remove unneeded logic from integration test setup (#1023)
1 parent 5190210 commit ad83ee3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/test/integration/IntegrationDeployer.t.sol

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
7979
// Set only once in setUp, if FORK_MAINNET env is set
8080
uint forkType;
8181

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

104+
=======
105+
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
103106
constructor() {
104107
address stETH_Holesky = 0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034;
105108
address stETH_Mainnet = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;
@@ -142,6 +145,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
142145
}
143146
}
144147

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

165176
// Deploy ProxyAdmin
166177
eigenLayerProxyAdmin = new ProxyAdmin();
@@ -235,11 +246,16 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
235246
allStrats.push(strategy);
236247
allTokens.push(strategy.underlyingToken());
237248
}
249+
<<<<<<< HEAD
238250

251+
=======
252+
253+
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
239254
// Create time machine and mock beacon chain
240255
BEACON_GENESIS_TIME = GENESIS_TIME_MAINNET;
241256
timeMachine = new TimeMachine();
242257
beaconChain = new BeaconChainMock(eigenPodManager, BEACON_GENESIS_TIME);
258+
<<<<<<< HEAD
243259

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

267+
=======
268+
}
269+
270+
/// Deploy current implementation contracts and upgrade existing proxies
271+
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
251272
function _upgradeMainnetContracts() public virtual {
252273
cheats.startPrank(address(executorMultisig));
253274

@@ -494,6 +515,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
494515
_configUserTypes(_userTypes);
495516
}
496517

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

533555
/// @dev Create a new user without native ETH. See _randUser above for standard usage
556+
=======
557+
/**
558+
<<<<<<< HEAD
559+
* Depending on the forkType, either deploy contracts locally or parse existing contracts
560+
* from network.
561+
*
562+
* Note: for non-LOCAL forktypes, upgrade of contracts will be performed after user initialization.
563+
*/
564+
function _deployOrFetchContracts() internal {
565+
if (forkType == LOCAL) {
566+
_setUpLocal();
567+
// Set Upgraded as local setup deploys most up to date contracts
568+
isUpgraded = true;
569+
} else if (forkType == MAINNET) {
570+
// cheats.selectFork(mainnetForkId);
571+
string memory deploymentInfoPath = "script/configs/mainnet/mainnet-addresses.config.json";
572+
_parseDeployedContracts(deploymentInfoPath);
573+
string memory existingDeploymentParams = "script/configs/mainnet.json";
574+
_parseParamsForIntegrationUpgrade(existingDeploymentParams);
575+
576+
// Unpause to enable deposits and withdrawals for initializing random user state
577+
cheats.prank(eigenLayerPauserReg.unpauser());
578+
strategyManager.unpause(0);
579+
580+
// Add deployed strategies to lstStrats and allStrats
581+
for (uint i; i < deployedStrategyArray.length; i++) {
582+
IStrategy strategy = IStrategy(deployedStrategyArray[i]);
583+
584+
>>>>>>> 9bfa14bd (test: remove unneeded logic from integration test setup (#1023))
534585
function _randUser_NoETH(
535586
string memory name
536587
) internal returns (User, IStrategy[] memory, uint[] memory) {

0 commit comments

Comments
 (0)