Skip to content

Commit

Permalink
test: upgrade delegate queue partial complete as shares
Browse files Browse the repository at this point in the history
  • Loading branch information
0xClandestine committed Feb 20, 2025
1 parent ca3be48 commit a148ba8
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,34 @@ contract Integration_Upgrade_Complete_PreSlashing_Withdrawal is UpgradeTest {
}
}

function testFuzz_upgrade_delegate_queuePartial_completeAsShares(uint24 _random) public rand(_random) {
/// 1. Create staker and operator with some asset amounts
(User staker, IStrategy[] memory strategies, uint[] memory tokenBalances) = _newRandomStaker();
(User operator, ,) = _newRandomOperator();

/// 2. Upgrade to slashing contracts
_upgradeEigenLayerContracts();

/// 3. Staker delegates to operator and deposits
staker.delegateTo(operator);
staker.depositIntoEigenlayer(strategies, tokenBalances);
uint[] memory shares = _calculateExpectedShares(strategies, tokenBalances);

/// 4. Queue partial withdrawal
uint[] memory partialShares = new uint[](shares.length);
for (uint i = 0; i < shares.length; i++) {
partialShares[i] = shares[i] / 2;
}
Withdrawal[] memory withdrawals = staker.queueWithdrawals(strategies, partialShares);

/// 5. Complete withdrawals as shares
_rollBlocksForCompleteWithdrawals(withdrawals);
for (uint i = 0; i < withdrawals.length; i++) {
staker.completeWithdrawalAsShares(withdrawals[i]);
check_Withdrawal_AsShares_State(staker, operator, withdrawals[i], strategies, partialShares);
}
}

function testFuzz_upgrade_delegate_queuePartial_completeAsTokens(uint24 _random) public rand(_random) {
/// 1. Create staker and operator with some asset amounts
(User staker, IStrategy[] memory strategies, uint[] memory tokenBalances) = _newRandomStaker();
Expand Down

0 comments on commit a148ba8

Please sign in to comment.