Skip to content

Commit ef603a7

Browse files
committed
refactor: review changes
1 parent f1ed2d5 commit ef603a7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/contracts/core/DelegationManager.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ contract DelegationManager is
523523
bytes32 withdrawalRoot = calculateWithdrawalRoot(withdrawal);
524524

525525
pendingWithdrawals[withdrawalRoot] = true;
526-
queuedWithdrawals[withdrawalRoot] = withdrawal;
526+
_queuedWithdrawals[withdrawalRoot] = withdrawal;
527527
_stakerQueuedWithdrawalRoots[staker].add(withdrawalRoot);
528528

529529
emit SlashingWithdrawalQueued(withdrawalRoot, withdrawal, withdrawableShares);
@@ -569,7 +569,7 @@ contract DelegationManager is
569569
// Remove the withdrawal from the queue. Note that for legacy withdrawals, the removals
570570
// from `_stakerQueuedWithdrawalRoots` and `queuedWithdrawals` will no-op.
571571
_stakerQueuedWithdrawalRoots[withdrawal.staker].remove(withdrawalRoot);
572-
delete queuedWithdrawals[withdrawalRoot];
572+
delete _queuedWithdrawals[withdrawalRoot];
573573
delete pendingWithdrawals[withdrawalRoot];
574574
emit SlashingWithdrawalCompleted(withdrawalRoot);
575575

@@ -803,7 +803,7 @@ contract DelegationManager is
803803
function _getSharesByWithdrawalRoot(
804804
bytes32 withdrawalRoot
805805
) internal view returns (Withdrawal memory withdrawal, uint256[] memory shares) {
806-
withdrawal = queuedWithdrawals[withdrawalRoot];
806+
withdrawal = _queuedWithdrawals[withdrawalRoot];
807807
shares = new uint256[](withdrawal.strategies.length);
808808

809809
uint32 slashableUntil = withdrawal.startBlock + MIN_WITHDRAWAL_DELAY_BLOCKS;
@@ -964,6 +964,12 @@ contract DelegationManager is
964964
return (strategies, shares);
965965
}
966966

967+
function queuedWithdrawals(
968+
bytes32 withdrawalRoot
969+
) external view returns (Withdrawal memory withdrawal) {
970+
return _queuedWithdrawals[withdrawalRoot];
971+
}
972+
967973
/// @inheritdoc IDelegationManager
968974
function getQueuedWithdrawal(
969975
bytes32 withdrawalRoot

src/contracts/core/DelegationManagerStorage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ abstract contract DelegationManagerStorage is IDelegationManager {
111111

112112
/// @notice Returns the details of a queued withdrawal given by `withdrawalRoot`.
113113
/// @dev This variable only reflects withdrawals that were made after the slashing release.
114-
mapping(bytes32 withdrawalRoot => Withdrawal withdrawal) public queuedWithdrawals;
114+
mapping(bytes32 withdrawalRoot => Withdrawal withdrawal) internal _queuedWithdrawals;
115115

116116
/// @notice Contains history of the total cumulative staker withdrawals for an operator and a given strategy.
117117
/// Used to calculate burned StrategyManager shares when an operator is slashed.

0 commit comments

Comments
 (0)