Skip to content

Commit cded635

Browse files
0xClandestineypatil12
authored andcommitted
test(redistribution-changes): passing (#1511)
**Motivation:** Test should be passing. **Modifications:** - Minor (likely rebase) error fixes. **Result:** Tests passing.
1 parent 5c04bf4 commit cded635

File tree

3 files changed

+45
-24
lines changed

3 files changed

+45
-24
lines changed

src/test/integration/IntegrationDeployer.t.sol

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -288,26 +288,43 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
288288
}
289289

290290
function _deployProxies() public {
291-
delegationManager =
292-
DelegationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
293-
strategyManager =
294-
StrategyManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
295-
eigenPodManager =
296-
EigenPodManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
297-
rewardsCoordinator =
298-
RewardsCoordinator(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
299-
avsDirectory = AVSDirectory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
300-
strategyFactory =
301-
StrategyFactory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
302-
allocationManager =
303-
AllocationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
304-
permissionController =
305-
PermissionController(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
306-
eigenPodBeacon = new UpgradeableBeacon(address(emptyContract));
307-
strategyBeacon = new UpgradeableBeacon(address(emptyContract));
308-
291+
if (address(delegationManager) == address(0)) {
292+
delegationManager =
293+
DelegationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
294+
}
295+
if (address(strategyManager) == address(0)) {
296+
strategyManager =
297+
StrategyManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
298+
}
299+
if (address(eigenPodManager) == address(0)) {
300+
eigenPodManager =
301+
EigenPodManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
302+
}
303+
if (address(rewardsCoordinator) == address(0)) {
304+
rewardsCoordinator =
305+
RewardsCoordinator(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
306+
}
307+
if (address(avsDirectory) == address(0)) {
308+
avsDirectory = AVSDirectory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
309+
}
310+
if (address(strategyFactory) == address(0)) {
311+
strategyFactory =
312+
StrategyFactory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
313+
}
314+
if (address(allocationManager) == address(0)) {
315+
allocationManager =
316+
AllocationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
317+
}
318+
if (address(permissionController) == address(0)) {
319+
permissionController =
320+
PermissionController(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
321+
}
322+
if (address(eigenPodBeacon) == address(0)) eigenPodBeacon = new UpgradeableBeacon(address(emptyContract));
323+
if (address(strategyBeacon) == address(0)) strategyBeacon = new UpgradeableBeacon(address(emptyContract));
309324
// multichain
310-
keyRegistrar = KeyRegistrar(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
325+
if (address(keyRegistrar) == address(0)) {
326+
keyRegistrar = KeyRegistrar(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
327+
}
311328
}
312329

313330
/// Deploy an implementation contract for each contract in the system

src/test/unit/BN254CertificateVerifierUnit.t.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ contract BN254CertificateVerifierUnitTests is
250250
_createOperatorsWithSplitKeys(123, numOperators, 0);
251251
BN254OperatorSetInfo memory operatorSetInfo = _createOperatorSetInfo(operatorInfos);
252252
vm.prank(address(operatorTableUpdaterMock));
253-
verifier.updateOperatorTable(defaultOperatorSet, uint32(block.timestamp), operatorSetInfo, defaultOperatorSetConfig);
253+
referenceTimestamp = uint32(block.timestamp);
254+
verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operatorSetInfo, defaultOperatorSetConfig);
255+
return referenceTimestamp;
254256
}
255257
}
256258

src/test/unit/OperatorTableUpdaterUnit.t.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ contract OperatorTableUpdaterUnitTests is
5050
"1.0.0"
5151
);
5252

53+
_setLatestReferenceTimestampBN254(generator, uint32(block.timestamp - 1));
54+
5355
eigenLayerProxyAdmin.upgradeAndCall(
5456
ITransparentUpgradeableProxy(payable(address(operatorTableUpdater))),
5557
address(operatorTableUpdaterImplementation),
@@ -66,6 +68,10 @@ contract OperatorTableUpdaterUnitTests is
6668
);
6769
}
6870

71+
function _setLatestReferenceTimestampBN254(OperatorSet memory operatorSet, uint32 referenceTimestamp) internal {
72+
bn254CertificateVerifierMock.setLatestReferenceTimestamp(operatorSet, referenceTimestamp);
73+
}
74+
6975
/// @dev Sets a valid certificate for the BN254 certificate verifier
7076
function _setIsValidCertificate(BN254Certificate memory certificate, bool isValid) internal {
7177
bn254CertificateVerifierMock.setIsValidCertificate(certificate, isValid);
@@ -289,10 +295,6 @@ contract OperatorTableUpdaterUnitTests_confirmGlobalTableRoot is OperatorTableUp
289295
}
290296

291297
contract OperatorTableUpdaterUnitTests_updateOperatorTable_BN254 is OperatorTableUpdaterUnitTests {
292-
function _setLatestReferenceTimestampBN254(OperatorSet memory operatorSet, uint32 referenceTimestamp) internal {
293-
bn254CertificateVerifierMock.setLatestReferenceTimestamp(operatorSet, referenceTimestamp);
294-
}
295-
296298
function testFuzz_BN254_revert_paused(Randomness r) public rand(r) {
297299
// Pause the updateOperatorTable functionality (bit index 1)
298300
uint pausedStatus = 1 << 1; // Set bit 1 to pause PAUSED_OPERATOR_TABLE_UPDATE

0 commit comments

Comments
 (0)