@@ -42,17 +42,14 @@ contract RegistryCoordinator is
42
42
using BN254 for BN254.G1Point;
43
43
44
44
modifier onlyEjector {
45
- require ( msg . sender == ejector, " RegistryCoordinator.onlyEjector: caller is not the ejector " );
45
+ _checkEjector ( );
46
46
_;
47
47
}
48
48
49
49
/// @dev Checks that `quorumNumber` corresponds to a quorum that has been created
50
50
/// via `initialize` or `createQuorum`
51
51
modifier quorumExists (uint8 quorumNumber ) {
52
- require (
53
- quorumNumber < quorumCount,
54
- "RegistryCoordinator.quorumExists: quorum does not exist "
55
- );
52
+ _checkQuorumExists (quorumNumber);
56
53
_;
57
54
}
58
55
@@ -517,6 +514,26 @@ contract RegistryCoordinator is
517
514
return results;
518
515
}
519
516
517
+ /**
518
+ * @notice Checks if the caller is the ejector
519
+ * @dev Reverts if the caller is not the ejector
520
+ */
521
+ function _checkEjector () internal view {
522
+ require (msg .sender == ejector, "RegistryCoordinator.onlyEjector: caller is not the ejector " );
523
+ }
524
+
525
+ /**
526
+ * @notice Checks if a quorum exists
527
+ * @param quorumNumber The quorum number to check
528
+ * @dev Reverts if the quorum does not exist
529
+ */
530
+ function _checkQuorumExists (uint8 quorumNumber ) internal view {
531
+ require (
532
+ quorumNumber < quorumCount,
533
+ "RegistryCoordinator.quorumExists: quorum does not exist "
534
+ );
535
+ }
536
+
520
537
/**
521
538
* @notice Fetches an operator's pubkey hash from the BLSApkRegistry. If the
522
539
* operator has not registered a pubkey, attempts to register a pubkey using
0 commit comments