Skip to content

Commit

Permalink
fixed breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Oct 10, 2023
1 parent a453970 commit 9af7c3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/contracts/pods/EigenPod.sol
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ contract EigenPod is IEigenPod, Initializable, ReentrancyGuardUpgradeable, Eigen
uint64 withdrawalAmountGwei,
ValidatorInfo memory validatorInfo
) internal returns (VerifiedWithdrawal memory) {
emit log("HELLO");
VerifiedWithdrawal memory verifiedWithdrawal;
uint256 withdrawalAmountWei;

Expand Down
30 changes: 18 additions & 12 deletions src/test/EigenPod.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
RESTAKED_BALANCE_OFFSET_GWEI,
GOERLI_GENESIS_TIME
);
podInternalFunctionTester = new EPInternalFunctions(ethPOSDeposit,
delayedWithdrawalRouter,
IEigenPodManager(podManagerAddress),
MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
RESTAKED_BALANCE_OFFSET_GWEI
);

eigenPodBeacon = new UpgradeableBeacon(address(podImplementation));

// this contract is deployed later to keep its address the same (for these tests)
Expand Down Expand Up @@ -428,6 +423,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
}

function testProcessFullWithdrawalForLessThanMaxRestakedBalance(uint64 withdrawalAmount) public {
_deployInternalFunctionTester();
cheats.assume(withdrawalAmount > 0 && withdrawalAmount < MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR);
IEigenPod.ValidatorInfo memory validatorInfo = IEigenPod.ValidatorInfo({
validatorIndex: 0,
Expand Down Expand Up @@ -1475,6 +1471,17 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
return uint64(GOERLI_GENESIS_TIME + slot * SECONDS_PER_SLOT);
}

function _deployInternalFunctionTester() internal {
podInternalFunctionTester = new EPInternalFunctions(
ethPOSDeposit,
delayedWithdrawalRouter,
IEigenPodManager(podManagerAddress),
MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
RESTAKED_BALANCE_OFFSET_GWEI,
GOERLI_GENESIS_TIME
);
}


}

Expand All @@ -1496,16 +1503,16 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
IDelayedWithdrawalRouter _delayedWithdrawalRouter,
IEigenPodManager _eigenPodManager,
uint64 _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
uint64 _RESTAKED_BALANCE_OFFSET_GWEI
uint64 _RESTAKED_BALANCE_OFFSET_GWEI,
uint64 _GENESIS_TIME
) EigenPod(
_ethPOS,
_delayedWithdrawalRouter,
_eigenPodManager,
_MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
_RESTAKED_BALANCE_OFFSET_GWEI
) {
emit log("CONTRUCTOR");
}
_RESTAKED_BALANCE_OFFSET_GWEI,
_GENESIS_TIME
) {}

function processFullWithdrawal(
uint40 validatorIndex,
Expand All @@ -1515,7 +1522,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
uint64 withdrawalAmountGwei,
ValidatorInfo memory validatorInfo
) public {
emit log_named_uint("withdrawalAmountGwei", withdrawalAmountGwei);
_processFullWithdrawal(
validatorIndex,
validatorPubkeyHash,
Expand Down

0 comments on commit 9af7c3a

Please sign in to comment.