Skip to content

Commit

Permalink
Make storage getters internal
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Nov 29, 2024
1 parent 179871c commit bf2ffcc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 110 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/validator-manager/PoSValidatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ abstract contract PoSValidatorManager is

// solhint-disable ordering
function _getPoSValidatorManagerStorage()
private
internal
pure
returns (PoSValidatorManagerStorage storage $)
{
Expand Down
10 changes: 1 addition & 9 deletions contracts/validator-manager/ValidatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida

// solhint-disable ordering
function _getValidatorManagerStorage()
private
internal
pure
returns (ValidatorManagerStorage storage $)
{
Expand Down Expand Up @@ -469,14 +469,6 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida
return (validationID, validator);
}

/**
* @notice Returns the validator's weight. This weight is not guaranteed to be known by the P-Chain
* @return Weight of the validator. If the validation ID does not exist, the weight will be 0.
*/
function getWeight(bytes32 validationID) external view returns (uint64) {
return getValidator(validationID).weight;
}

function _incrementAndGetNonce(bytes32 validationID) internal returns (uint64) {
ValidatorManagerStorage storage $ = _getValidatorManagerStorage();
return ++$._validationPeriods[validationID].messageNonce;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest {

_completeEndDelegation(delegationID, weightUpdateMessage);

assertEq(posValidatorManager.getWeight(validationID), expectedValidatorWeight);
assertEq(posValidatorManager.getValidator(validationID).weight, expectedValidatorWeight);

if (rewardRecipient == delegator) {
assertEq(
Expand Down

0 comments on commit bf2ffcc

Please sign in to comment.