diff --git a/src/BLSApkRegistry.sol b/src/BLSApkRegistry.sol index 4fd0e2fb..2bad724b 100644 --- a/src/BLSApkRegistry.sol +++ b/src/BLSApkRegistry.sol @@ -12,10 +12,7 @@ contract BLSApkRegistry is BLSApkRegistryStorage { /// @notice when applied to a function, only allows the RegistryCoordinator to call it modifier onlyRegistryCoordinator() { - require( - msg.sender == address(registryCoordinator), - "BLSApkRegistry.onlyRegistryCoordinator: caller is not the registry coordinator" - ); + _checkRegistryCoordinator(); _; } @@ -281,4 +278,11 @@ contract BLSApkRegistry is BLSApkRegistryStorage { function getOperatorId(address operator) public view returns (bytes32) { return operatorToPubkeyHash[operator]; } + + function _checkRegistryCoordinator() internal view { + require( + msg.sender == address(registryCoordinator), + "BLSApkRegistry.onlyRegistryCoordinator: caller is not the registry coordinator" + ); + } }