Skip to content

Commit

Permalink
chore: simplify fork logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Jan 30, 2025
1 parent 8697cb1 commit d849720
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/test/integration/tests/upgrade/Prooftra.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ contract Integration_Upgrade_Pectra is UpgradeTest {
_upgradeEigenLayerContracts();
_hardForkToPectra();

// Randomly advance timestamp to be just after the hard fork timestamp
if (_randBool()) {
cheats.warp(block.timestamp + 1);
}

// 2. Initialize Staker
(User staker, ,) = _newRandomStaker();
(uint40[] memory validators, uint64 beaconBalanceGwei) = staker.startValidators();
Expand Down Expand Up @@ -74,11 +69,6 @@ contract Integration_Upgrade_Pectra is UpgradeTest {
_upgradeEigenLayerContracts();
_hardForkToPectra();

// Randomly advance timestamp to be just after the hard fork timestamp
if (_randBool()) {
cheats.warp(block.timestamp + 1);
}

// 3. Advance epoch, generating consensus rewards and withdrawing anything over 32 ETH
beaconChain.advanceEpoch();
uint64 expectedWithdrawnGwei = uint64(validators.length) * beaconChain.CONSENSUS_REWARD_AMOUNT_GWEI();
Expand All @@ -94,6 +84,10 @@ contract Integration_Upgrade_Pectra is UpgradeTest {

function _hardForkToPectra() internal {
beaconChain.forkToPectra();
}

// Randomly advance timestamp to be just after the hard fork timestamp
if (_randBool()) {
cheats.warp(block.timestamp + 1);
}
}
}

0 comments on commit d849720

Please sign in to comment.