Skip to content

Commit

Permalink
Merge pull request #3 from Layr-Labs/alex/allow-override
Browse files Browse the repository at this point in the history
mark some methods public+virtual for ease of override
  • Loading branch information
wadealexc authored Oct 18, 2023
2 parents cf71ce1 + eb23eca commit d6044ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/BLSPubkeyRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract BLSPubkeyRegistry is BLSPubkeyRegistryStorage {
address operator,
bytes memory quorumNumbers,
BN254.G1Point memory pubkey
) external onlyRegistryCoordinator returns (bytes32) {
) public virtual onlyRegistryCoordinator returns (bytes32) {
//calculate hash of the operator's pubkey
bytes32 pubkeyHash = BN254.hashG1Point(pubkey);

Expand Down Expand Up @@ -79,7 +79,7 @@ contract BLSPubkeyRegistry is BLSPubkeyRegistryStorage {
address operator,
bytes memory quorumNumbers,
BN254.G1Point memory pubkey
) external onlyRegistryCoordinator {
) public virtual onlyRegistryCoordinator {
bytes32 pubkeyHash = BN254.hashG1Point(pubkey);

require(
Expand Down
4 changes: 2 additions & 2 deletions src/BLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
bytes calldata quorumNumbers,
BN254.G1Point memory pubkey,
string memory socket
) internal returns(uint32[] memory) {
) internal virtual returns(uint32[] memory) {
// require(
// slasher.contractCanSlashOperatorUntilBlock(operator, address(serviceManager)) == type(uint32).max,
// "StakeRegistry._registerOperator: operator must be opted into slashing by the serviceManager"
Expand Down Expand Up @@ -464,7 +464,7 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
bytes calldata quorumNumbers,
BN254.G1Point memory pubkey,
bytes32[] memory operatorIdsToSwap
) internal {
) internal virtual {
require(_operators[operator].status == OperatorStatus.REGISTERED, "BLSRegistryCoordinatorWithIndices._deregisterOperatorWithCoordinator: operator is not registered");

// get the operatorId of the operator
Expand Down
4 changes: 2 additions & 2 deletions src/IndexRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract IndexRegistry is IndexRegistryStorage {
function registerOperator(
bytes32 operatorId,
bytes calldata quorumNumbers
) external onlyRegistryCoordinator returns(uint32[] memory) {
) public virtual onlyRegistryCoordinator returns(uint32[] memory) {
uint32[] memory numOperatorsPerQuorum = new uint32[](quorumNumbers.length);
//add operator to operatorList
globalOperatorList.push(operatorId);
Expand Down Expand Up @@ -84,7 +84,7 @@ contract IndexRegistry is IndexRegistryStorage {
bytes32 operatorId,
bytes calldata quorumNumbers,
bytes32[] memory operatorIdsToSwap
) external onlyRegistryCoordinator {
) public virtual onlyRegistryCoordinator {
require(
quorumNumbers.length == operatorIdsToSwap.length,
"IndexRegistry.deregisterOperator: quorumNumbers and operatorIdsToSwap must be the same length"
Expand Down
4 changes: 2 additions & 2 deletions src/StakeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ contract StakeRegistry is StakeRegistryStorage {
address operator,
bytes32 operatorId,
bytes calldata quorumNumbers
) external virtual onlyRegistryCoordinator {
) public virtual onlyRegistryCoordinator {
// check the operator is registering for only valid quorums
require(
uint8(quorumNumbers[quorumNumbers.length - 1]) < quorumCount,
Expand Down Expand Up @@ -210,7 +210,7 @@ contract StakeRegistry is StakeRegistryStorage {
function deregisterOperator(
bytes32 operatorId,
bytes calldata quorumNumbers
) external virtual onlyRegistryCoordinator {
) public virtual onlyRegistryCoordinator {
OperatorStakeUpdate memory _operatorStakeUpdate;
// add the `updateBlockNumber` info
_operatorStakeUpdate.updateBlockNumber = uint32(block.number);
Expand Down

0 comments on commit d6044ea

Please sign in to comment.