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

Add test for Set Max Nodes on Staking Nodes Manager #30

Merged
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
20 changes: 13 additions & 7 deletions test/foundry/integration/StakingNodesManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import {IntegrationBaseTest} from "./IntegrationBaseTest.sol";
import {IStakingNode} from "../../../src/interfaces/IStakingNode.sol";
import {IEigenPod} from "../../../src/external/eigenlayer/v0.1.0/interfaces/IEigenPod.sol";
import {IStakingNodesManager} from "../../../src/interfaces/IStakingNodesManager.sol";
import "forge-std/console.sol";
import "../../../src/StakingNodesManager.sol";
import "../../../src/ynETH.sol";
import "../mocks/TestStakingNodeV2.sol";
import "../mocks/TestStakingNodesManagerV2.sol";
import {StakingNodesManager} from "../../../src/StakingNodesManager.sol";
import {ynETH} from "../../../src/ynETH.sol";
import {TestStakingNodeV2} from "../mocks/TestStakingNodeV2.sol";
import {TestStakingNodesManagerV2} from "../mocks/TestStakingNodesManagerV2.sol";


contract StakingNodesManagerStakingNodeCreation is IntegrationBaseTest {
Expand Down Expand Up @@ -90,6 +89,15 @@ contract StakingNodesManagerStakingNodeCreation is IntegrationBaseTest {
vm.expectRevert("AccessControlUnauthorizedAccount");
stakingNodesManager.createStakingNode();
}

function testSetMaxNodeCount() public {
uint256 initialMaxNodeCount = stakingNodesManager.maxNodeCount();
uint256 newMaxNodeCount = initialMaxNodeCount + 1;
vm.prank(actors.STAKING_ADMIN);
stakingNodesManager.setMaxNodeCount(newMaxNodeCount);
uint256 updatedMaxNodeCount = stakingNodesManager.maxNodeCount();
assertEq(updatedMaxNodeCount, newMaxNodeCount, "Max node count does not match expected value");
}
}

contract StakingNodesManagerStakingNodeImplementation is IntegrationBaseTest {
Expand Down Expand Up @@ -316,7 +324,6 @@ contract StakingNodesManagerRegisterValidators is IntegrationBaseTest {
function testRegisterValidatorsWithInsufficientDeposit() public {
address addr1 = vm.addr(100);
vm.deal(addr1, 100 ether);
uint validatorCount = 1;
uint depositAmount = 16 ether; // Insufficient deposit amount
vm.prank(addr1);
yneth.depositETH{value: depositAmount}(addr1);
Expand Down Expand Up @@ -423,7 +430,6 @@ contract StakingNodesManagerViews is IntegrationBaseTest {
contract StakingNodesManagerMisc is IntegrationBaseTest {

function testSendingETHToStakingNodesManagerShouldRevert() public {
uint256 initialBalance = address(stakingNodesManager).balance;
uint256 amountToSend = 1 ether;

// Send ETH to the StakingNodesManager contract
Expand Down