Skip to content

Make virtual functions on ECDSAStakeRegistry #2

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

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/unaudited/ECDSAStakeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract ECDSAStakeRegistry is
address _serviceManager,
uint256 thresholdWeight,
IECDSAStakeRegistryTypes.Quorum memory quorum
) external initializer {
) virtual external initializer {
__ECDSAStakeRegistry_init(_serviceManager, thresholdWeight, quorum);
}

Expand All @@ -71,19 +71,19 @@ contract ECDSAStakeRegistry is
function registerOperatorWithSignature(
ISignatureUtilsMixinTypes.SignatureWithSaltAndExpiry memory operatorSignature,
address signingKey
) external {
) virtual external {
_registerOperatorWithSig(msg.sender, operatorSignature, signingKey);
}

/// @inheritdoc IECDSAStakeRegistry
function deregisterOperator() external {
function deregisterOperator() virtual external {
_deregisterOperator(msg.sender);
}

/// @inheritdoc IECDSAStakeRegistry
function updateOperatorSigningKey(
address newSigningKey
) external {
) virtual external {
if (!_operatorRegistered[msg.sender]) {
revert OperatorNotRegistered();
}
Expand All @@ -93,15 +93,15 @@ contract ECDSAStakeRegistry is
/// @inheritdoc IECDSAStakeRegistry
function updateOperators(
address[] memory operators
) external {
) virtual external {
_updateOperators(operators);
}

/// @inheritdoc IECDSAStakeRegistry
function updateQuorumConfig(
IECDSAStakeRegistryTypes.Quorum memory quorum,
address[] memory operators
) external onlyOwner {
) virtual external onlyOwner {
_updateQuorumConfig(quorum);
_updateOperators(operators);
}
Expand All @@ -110,22 +110,22 @@ contract ECDSAStakeRegistry is
function updateMinimumWeight(
uint256 newMinimumWeight,
address[] memory operators
) external onlyOwner {
) virtual external onlyOwner {
_updateMinimumWeight(newMinimumWeight);
_updateOperators(operators);
}

/// @inheritdoc IECDSAStakeRegistry
function updateStakeThreshold(
uint256 thresholdWeight
) external onlyOwner {
) virtual external onlyOwner {
_updateStakeThreshold(thresholdWeight);
}

function isValidSignature(
bytes32 digest,
bytes memory _signatureData
) external view returns (bytes4) {
) virtual external view returns (bytes4) {
(address[] memory operators, bytes[] memory signatures, uint32 referenceBlock) =
abi.decode(_signatureData, (address[], bytes[], uint32));
_checkSignatures(digest, operators, signatures, referenceBlock);
Expand Down Expand Up @@ -221,7 +221,7 @@ contract ECDSAStakeRegistry is
/// @inheritdoc IECDSAStakeRegistry
function getOperatorWeight(
address operator
) public view returns (uint256) {
) public virtual view returns (uint256) {
StrategyParams[] memory strategyParams = _quorum.strategies;
uint256 weight;
IStrategy[] memory strategies = new IStrategy[](strategyParams.length);
Expand All @@ -245,7 +245,7 @@ contract ECDSAStakeRegistry is
function updateOperatorsForQuorum(
address[][] memory operatorsPerQuorum,
bytes memory
) external {
) virtual external {
_updateAllOperators(operatorsPerQuorum[0]);
}

Expand Down