Skip to content

Commit

Permalink
feat: add getValidatorUpdateTime in StakeHub and getProtector in Prot…
Browse files Browse the repository at this point in the history
…ectable
  • Loading branch information
cosinlink committed Oct 9, 2024
1 parent 9cd90d1 commit 8d4f2e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contracts/StakeHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,17 @@ contract StakeHub is SystemV2, Initializable, Protectable {
return _validators[operatorAddress].agent;
}

/**
* @param operatorAddress the operator address of the validator
*
* @return the updateTime of a validator
*/
function getValidatorUpdateTime(
address operatorAddress
) external view validatorExist(operatorAddress) returns (uint256) {
return _validators[operatorAddress].updateTime;
}

/**
* @dev this function will be used by Parlia consensus engine.
*
Expand Down
5 changes: 5 additions & 0 deletions contracts/extension/Protectable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,10 @@ abstract contract Protectable is Initializable {
_protector = protector;
}

/*----------------- view functions -----------------*/
function getProtector() external view returns (address) {
return _protector;
}

uint256[50] private __reservedSlot;
}

0 comments on commit 8d4f2e9

Please sign in to comment.