Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix faiIng tests on EigenStrategyManagerTest #211

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions test/integration/ynEIGEN/EigenStrategyManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ contract EigenStrategyManagerTest is ynEigenIntegrationBaseTest {
// uint256 rethAmount = 5018;
// uint256 sfrxethAmount = 17119; // 1.711e4

uint256 assetCount = 4;
uint256 assetCount = _isHolesky() ? 3 : 4;

// Call with arrays and from controller
IERC20[] memory assetsToDeposit = new IERC20[](assetCount);
assetsToDeposit[0] = IERC20(chainAddresses.lsd.WSTETH_ADDRESS);
assetsToDeposit[1] = IERC20(chainAddresses.lsd.WOETH_ADDRESS);
assetsToDeposit[1] = IERC20(chainAddresses.lsd.SFRXETH_ADDRESS);
assetsToDeposit[2] = IERC20(chainAddresses.lsd.RETH_ADDRESS);
assetsToDeposit[3] = IERC20(chainAddresses.lsd.SFRXETH_ADDRESS);
if (!_isHolesky()) assetsToDeposit[3] = IERC20(chainAddresses.lsd.WOETH_ADDRESS);

uint256[] memory amounts = new uint256[](assetCount);
amounts[0] = wstethAmount;
amounts[1] = woethAmount;
amounts[1] = sfrxethAmount;
amounts[2] = rethAmount;
amounts[3] = sfrxethAmount;
if (!_isHolesky()) amounts[3] = woethAmount;

for (uint256 i = 0; i < assetCount; i++) {
address prankedUser = depositors[i];
Expand Down Expand Up @@ -122,7 +122,7 @@ contract EigenStrategyManagerTest is ynEigenIntegrationBaseTest {
function testStakeAssetsToMultipleNodes(
uint256 wstethAmount,
uint256 woethAmount
) public {
) public skipOnHolesky {

vm.assume(
wstethAmount < 1000 ether && wstethAmount >= 2 wei &&
Expand Down Expand Up @@ -196,14 +196,16 @@ contract EigenStrategyManagerTest is ynEigenIntegrationBaseTest {
address expectedStrategyForSFRXETH = chainAddresses.lsdStrategies.SFRXETH_STRATEGY_ADDRESS;

assertEq(address(eigenStrategyManager.strategies(IERC20(wstethAsset))), expectedStrategyForWSTETH, "Incorrect strategy for WSTETH");
assertEq(address(eigenStrategyManager.strategies(IERC20(woethAsset))), expectedStrategyForWOETH, "Incorrect strategy for WOETH");
if (!_isHolesky()) {
assertEq(address(eigenStrategyManager.strategies(IERC20(woethAsset))), expectedStrategyForWOETH, "Incorrect strategy for WOETH");
}
assertEq(address(eigenStrategyManager.strategies(IERC20(rethAsset))), expectedStrategyForRETH, "Incorrect strategy for RETH");
assertEq(address(eigenStrategyManager.strategies(IERC20(sfrxethAsset))), expectedStrategyForSFRXETH, "Incorrect strategy for SFRXETH");
}

function testAddStrategySuccess() public {
IERC20 newAsset = IERC20(chainAddresses.lsd.SWELL_ADDRESS); // Using SWELL as the new asset
IStrategy newStrategy = IStrategy(chainAddresses.lsdStrategies.SWELL_STRATEGY_ADDRESS); // Using SWELL strategy
IERC20 newAsset = IERC20(chainAddresses.lsd.CBETH_ADDRESS); // Using CBETH as the new asset
IStrategy newStrategy = IStrategy(chainAddresses.lsdStrategies.CBETH_STRATEGY_ADDRESS); // Using CBETH strategy

// Initially, there should be no strategy set for newAsset
assertEq(address(eigenStrategyManager.strategies(newAsset)), address(0), "Strategy already set for new asset");
Expand All @@ -217,8 +219,8 @@ contract EigenStrategyManagerTest is ynEigenIntegrationBaseTest {
}

function testAddStrategyTwice() public {
IERC20 existingAsset = IERC20(chainAddresses.lsd.SWELL_ADDRESS);
IStrategy existingStrategy = IStrategy(chainAddresses.lsdStrategies.SWELL_STRATEGY_ADDRESS);
IERC20 existingAsset = IERC20(chainAddresses.lsd.CBETH_ADDRESS);
IStrategy existingStrategy = IStrategy(chainAddresses.lsdStrategies.CBETH_STRATEGY_ADDRESS);

// Setup: Add a strategy initially
vm.prank(actors.admin.EIGEN_STRATEGY_ADMIN);
Expand All @@ -230,10 +232,10 @@ contract EigenStrategyManagerTest is ynEigenIntegrationBaseTest {
}

function testAddStrategyWithMismatchedUnderlyingToken() public {
IERC20 asset = IERC20(chainAddresses.lsd.SWELL_ADDRESS); // Using SWELL as the asset
IStrategy mismatchedStrategy = IStrategy(chainAddresses.lsdStrategies.OETH_STRATEGY_ADDRESS); // Incorrect strategy for SWELL
IERC20 asset = IERC20(chainAddresses.lsd.CBETH_ADDRESS); // Using CBETH as the asset
IStrategy mismatchedStrategy = IStrategy(chainAddresses.lsdStrategies.METH_STRATEGY_ADDRESS); // Incorrect strategy for CBETH

// Setup: Ensure the underlying token of the mismatched strategy is not SWELL
// Setup: Ensure the underlying token of the mismatched strategy is not CBETH
assertNotEq(address(mismatchedStrategy.underlyingToken()), address(asset), "Underlying token should not match asset");

// Attempt to add a strategy with a mismatched underlying token
Expand Down
Loading