From da9eda0f53f379a9be30699d30a287a4327ca735 Mon Sep 17 00:00:00 2001 From: danoctavian Date: Mon, 14 Oct 2024 03:00:41 +0300 Subject: [PATCH] fix all remaining warnings --- test/integration/M3/Base.t.sol | 1 - .../integration/M3/WithdrawalsWithRewards-Scenario.t.sol | 6 +++--- test/integration/StakingNode.t.sol | 5 ----- test/integration/StakingNodeTestBase.sol | 3 +++ test/unit/ynETHWithdrawalQueueManager_unit.t.sol | 9 ++++----- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/test/integration/M3/Base.t.sol b/test/integration/M3/Base.t.sol index 44b3c0108..1e4bf6f2d 100644 --- a/test/integration/M3/Base.t.sol +++ b/test/integration/M3/Base.t.sol @@ -295,7 +295,6 @@ contract Base is Test, Utils { console.log("EigenPod shares for each StakingNode:"); for (uint256 i = 0; i < stakingNodesManager.nodesLength(); i++) { IStakingNode stakingNode = stakingNodesManager.nodes(i); - address eigenPodAddress = address(stakingNode.eigenPod()); uint256 podShares = uint256(IEigenPodManager(chainAddresses.eigenlayer.EIGENPOD_MANAGER_ADDRESS).podOwnerShares(address(stakingNode))); console.log("Node", i, "Shares:", podShares); } diff --git a/test/integration/M3/WithdrawalsWithRewards-Scenario.t.sol b/test/integration/M3/WithdrawalsWithRewards-Scenario.t.sol index 803eb0fa8..fa95e6910 100644 --- a/test/integration/M3/WithdrawalsWithRewards-Scenario.t.sol +++ b/test/integration/M3/WithdrawalsWithRewards-Scenario.t.sol @@ -122,11 +122,11 @@ contract M3WithdrawalsWithRewardsTest is Base { } - function startAndVerifyCheckpoint(uint256 nodeId, TestState memory state) private { + function startAndVerifyCheckpoint(uint256 _nodeId, TestState memory state) private { // start checkpoint { vm.startPrank(actors.ops.STAKING_NODES_OPERATOR); - stakingNodesManager.nodes(nodeId).startCheckpoint(true); + stakingNodesManager.nodes(_nodeId).startCheckpoint(true); vm.stopPrank(); } @@ -134,7 +134,7 @@ contract M3WithdrawalsWithRewardsTest is Base { // verify checkpoints { - IStakingNode _node = stakingNodesManager.nodes(nodeId); + IStakingNode _node = stakingNodesManager.nodes(_nodeId); CheckpointProofs memory _cpProofs = beaconChain.getCheckpointProofs(validatorIndices, _node.eigenPod().currentCheckpointTimestamp()); IPod(address(_node.eigenPod())).verifyCheckpointProofs({ balanceContainerProof: _cpProofs.balanceContainerProof, diff --git a/test/integration/StakingNode.t.sol b/test/integration/StakingNode.t.sol index 9511a618e..8a7394425 100644 --- a/test/integration/StakingNode.t.sol +++ b/test/integration/StakingNode.t.sol @@ -64,9 +64,6 @@ contract StakingNodeEigenPod is StakingNodeTestBase { (bool success,) = eigenPodAddress.call{value: rewardsSweeped}(""); require(success, "Failed to send rewards to EigenPod"); - // Get final pod owner shares - int256 finalPodOwnerShares = eigenPodManager.podOwnerShares(address(stakingNodeInstance)); - // Assert that pod owner shares remain the same assertEq(initialPodOwnerShares, 0, "Pod owner shares should not change"); } @@ -241,8 +238,6 @@ contract StakingNodeDelegation is StakingNodeTestBase { contract StakingNodeVerifyWithdrawalCredentials is StakingNodeTestBase { address user = vm.addr(156737); - - uint256 nodeId; uint40[] validatorIndices; uint256 AMOUNT = 32 ether; diff --git a/test/integration/StakingNodeTestBase.sol b/test/integration/StakingNodeTestBase.sol index faded9327..1e6f6864d 100644 --- a/test/integration/StakingNodeTestBase.sol +++ b/test/integration/StakingNodeTestBase.sol @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: BSD 3-Clause License +pragma solidity ^0.8.24; + import {IntegrationBaseTest} from "test/integration/IntegrationBaseTest.sol"; import {IStakingNode} from "src/interfaces/IStakingNode.sol"; import {IDelegationManager} from "lib/eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol"; diff --git a/test/unit/ynETHWithdrawalQueueManager_unit.t.sol b/test/unit/ynETHWithdrawalQueueManager_unit.t.sol index 3c3f49c18..b23ec69ab 100644 --- a/test/unit/ynETHWithdrawalQueueManager_unit.t.sol +++ b/test/unit/ynETHWithdrawalQueueManager_unit.t.sol @@ -481,7 +481,6 @@ contract ynETHWithdrawalQueueManagerTest is Test { uint256 _amount ) public { vm.assume(_amount > 0 && _amount < 10_000 ether); - uint256 _amount = 1 ether; vm.deal(address(redemptionAssetsVault), _amount); @@ -513,7 +512,7 @@ contract ynETHWithdrawalQueueManagerTest is Test { uint256 _redemptionRateAtRequestTime = redemptionAssetsVault.redemptionRate(); - uint256 finalizationId = finalizeRequest(tokenId); + finalizeRequest(tokenId); uint256 extraWithdrawalsAfter = 2; @@ -766,7 +765,7 @@ contract ynETHWithdrawalQueueManagerTest is Test { for (uint256 i = 0; i < requestIndex; i++) { vm.startPrank(user); redeemableAsset.approve(address(manager), requestedAmounts[i]); - uint256 tokenId = manager.requestWithdrawal(requestedAmounts[i]); + manager.requestWithdrawal(requestedAmounts[i]); vm.stopPrank(); vm.deal(address(redemptionAssetsVault), requestedAmounts[i]); @@ -814,7 +813,7 @@ contract ynETHWithdrawalQueueManagerTest is Test { uint256 amount = 1 ether; vm.startPrank(user); redeemableAsset.approve(address(manager), amount); - uint256 tokenId = manager.requestWithdrawal(amount); + manager.requestWithdrawal(amount); vm.stopPrank(); // Ensure the request was made successfully @@ -1054,7 +1053,7 @@ contract ynETHWithdrawalQueueManagerTest is Test { vm.startPrank(anotherUser); redeemableAsset.approve(address(manager), requestAmounts[3]); - uint256 request4 = manager.requestWithdrawal(requestAmounts[3]); + manager.requestWithdrawal(requestAmounts[3]); vm.stopPrank(); // Test: Retrieve withdrawal requests for the main user