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

Centralize reward management in PoSValidatorManager #643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richardpringle
Copy link

@richardpringle richardpringle commented Nov 13, 2024

Why this should be merged

If any of the reward logic changes, the change happens in one place. For the delegator, the logic only existed in one place before, but this keeps the pattern consistent and improves the readability of _completeEndDelegation function.

How this works

Same as before, I just moved code

How this was tested

Existing tests

How is this documented

inline docs on new functions

@@ -760,4 +744,41 @@ abstract contract PoSValidatorManager is
PoSValidatorManagerStorage storage $ = _getPoSValidatorManagerStorage();
return $._posValidatorInfo[validationID].owner != address(0);
}

function _withdrawValidationRewards(address rewardRecipient, bytes32 validationID) internal {
PoSValidatorManagerStorage storage $ = _getPoSValidatorManagerStorage();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make more sense to pass this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 🗄️
Development

Successfully merging this pull request may close these issues.

1 participant