Skip to content

Commit

Permalink
cleaned up all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Oct 23, 2023
1 parent e82d102 commit df04234
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 32 deletions.
10 changes: 4 additions & 6 deletions src/test/EigenPod.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
_deployInternalFunctionTester();

setJSON("./src/test/test-data/balanceUpdateProof_notOverCommitted_302913.json");
bytes32[] memory validatorFields = getValidatorFields();
validatorFields = getValidatorFields();

uint40[] memory validatorIndices = new uint40[](1);
validatorIndices[0] = uint40(getValidatorIndex());
Expand Down Expand Up @@ -1045,7 +1045,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
}

//post M2, all new pods deployed will have "hasRestaked = true". THis tests that
function testDeployedPodIsRestaked(address podOwner) public fuzzedAddress(podOwner) {
function testDeployedPodIsRestaked() public fuzzedAddress(podOwner) {
cheats.startPrank(podOwner);
eigenPodManager.createPod();
cheats.stopPrank();
Expand Down Expand Up @@ -1223,7 +1223,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
newPod.verifyBalanceUpdates(oracleTimestamp, validatorIndices, stateRootProofStruct, proofs, validatorFieldsArray);
}

function testWithdrawlBeforeRestakingFromNonPodOwnerAddress(uint256 amount, address nonPodOwner) external {
function testWithdrawlBeforeRestakingFromNonPodOwnerAddress(address nonPodOwner) external {
cheats.assume(nonPodOwner != podOwner);
cheats.startPrank(podOwner);
IEigenPod newPod = eigenPodManager.getPod(podOwner);
Expand All @@ -1232,8 +1232,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
eigenPodManager.stake{value: stakeAmount}(pubkey, signature, depositDataRoot);
cheats.stopPrank();

uint256 amount = 32 ether;

cheats.store(address(newPod), bytes32(uint256(52)), bytes32(0));

cheats.startPrank(nonPodOwner);
Expand All @@ -1242,7 +1240,7 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
cheats.stopPrank();
}

function testDelayedWithdrawalIsCreatedByWithdrawBeforeRestaking(uint256 amount) external {
function testDelayedWithdrawalIsCreatedByWithdrawBeforeRestaking() external {
cheats.startPrank(podOwner);
IEigenPod newPod = eigenPodManager.getPod(podOwner);
cheats.expectEmit(true, true, true, true, address(newPod));
Expand Down
2 changes: 1 addition & 1 deletion src/test/mocks/EigenPodManagerMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract EigenPodManagerMock is IEigenPodManager, Test {

function podOwnerShares(address podOwner) external view returns (int256) {}

function addShares(address /*podOwner*/, uint256 shares) external returns (uint256) {
function addShares(address /*podOwner*/, uint256 shares) external pure returns (uint256) {
// this is the "increase in delegateable tokens"
return (shares);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/mocks/StakeRegistryMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ contract StakeRegistryMock is IStakeRegistry {
}
}

function getMockOperatorId(address operator) external returns(bytes32) {
function getMockOperatorId(address operator) external pure returns(bytes32) {
return bytes32(uint256(keccak256(abi.encodePacked(operator, "operatorId"))));
}
}
30 changes: 6 additions & 24 deletions src/test/unit/DelegationUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1925,11 +1925,7 @@ contract DelegationUnitTests is EigenLayerTestHelper {
IStrategy strategy = strategyMock;
IERC20 token = strategy.underlyingToken();

(
IDelegationManager.Withdrawal memory withdrawal,
IERC20[] memory tokensArray,
bytes32 withdrawalRoot
) = _setUpWithdrawalStructSingleStrat(
(IDelegationManager.Withdrawal memory withdrawal, IERC20[] memory tokensArray, ) = _setUpWithdrawalStructSingleStrat(
/*staker*/ address(this),
/*withdrawer*/ address(this),
token,
Expand Down Expand Up @@ -2197,11 +2193,7 @@ contract DelegationUnitTests is EigenLayerTestHelper {

_depositIntoStrategySuccessfully(strategyMock, staker, depositAmount);

(
IDelegationManager.Withdrawal memory withdrawal,
IERC20[] memory tokensArray,
bytes32 withdrawalRoot
) = _setUpWithdrawalStructSingleStrat(
(IDelegationManager.Withdrawal memory withdrawal, , ) = _setUpWithdrawalStructSingleStrat(
/*staker*/ address(this),
/*withdrawer*/ address(this),
mockToken,
Expand Down Expand Up @@ -2233,11 +2225,7 @@ contract DelegationUnitTests is EigenLayerTestHelper {

_depositIntoStrategySuccessfully(strategyMock, staker, depositAmount);

(
IDelegationManager.Withdrawal memory withdrawal,
IERC20[] memory tokensArray,
bytes32 withdrawalRoot
) = _setUpWithdrawalStructSingleStrat(
(IDelegationManager.Withdrawal memory withdrawal, , ) = _setUpWithdrawalStructSingleStrat(
/*staker*/ address(this),
/*withdrawer*/ address(this),
mockToken,
Expand Down Expand Up @@ -2285,17 +2273,14 @@ contract DelegationUnitTests is EigenLayerTestHelper {
_depositIntoStrategySuccessfully(strategies[1], staker, depositAmounts[1]);
_depositIntoStrategySuccessfully(strategies[2], staker, depositAmounts[2]);

(
IDelegationManager.Withdrawal memory queuedWithdrawal,
bytes32 withdrawalRoot
) = _setUpWithdrawalStruct_MultipleStrategies(
( ,bytes32 withdrawalRoot) = _setUpWithdrawalStruct_MultipleStrategies(
/* staker */ staker,
/* withdrawer */ staker,
strategies,
amounts
);
require(!delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRootPendingBefore is true!");
uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker);
delegationManager.cumulativeWithdrawalsQueued(staker);
uint256[] memory sharesBefore = new uint256[](3);
sharesBefore[0] = strategyManager.stakerStrategyShares(staker, strategies[0]);
sharesBefore[1] = strategyManager.stakerStrategyShares(staker, strategies[1]);
Expand Down Expand Up @@ -2368,10 +2353,7 @@ contract DelegationUnitTests is EigenLayerTestHelper {
amounts[1] = 2e18;
amounts[2] = 3e18;

(
IDelegationManager.Withdrawal memory withdrawal,
bytes32 withdrawalRoot
) = _setUpWithdrawalStruct_MultipleStrategies({
(IDelegationManager.Withdrawal memory withdrawal, ) = _setUpWithdrawalStruct_MultipleStrategies({
staker: staker,
withdrawer: withdrawer,
strategyArray: strategies,
Expand Down
3 changes: 3 additions & 0 deletions src/test/utils/EigenPodHarness.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "../../contracts/pods/EigenPod.sol";

contract EPInternalFunctions is EigenPod {
Expand Down

0 comments on commit df04234

Please sign in to comment.