Skip to content

Commit 7ba1b98

Browse files
committed
refactor: test passing **mostly**
1 parent f401ca5 commit 7ba1b98

7 files changed

+59
-70
lines changed

src/SlashingRegistryCoordinator.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ contract SlashingRegistryCoordinator is
129129
function createTotalDelegatedStakeQuorum(
130130
OperatorSetParam memory operatorSetParams,
131131
uint96 minimumStake,
132-
IStakeRegistry.StrategyParams[] memory strategyParams
132+
IStakeRegistryTypes.StrategyParams[] memory strategyParams
133133
) external virtual onlyOwner {
134134
_createQuorum(
135135
operatorSetParams,
@@ -143,7 +143,7 @@ contract SlashingRegistryCoordinator is
143143
function createSlashableStakeQuorum(
144144
OperatorSetParam memory operatorSetParams,
145145
uint96 minimumStake,
146-
IStakeRegistry.StrategyParams[] memory strategyParams,
146+
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
147147
uint32 lookAheadPeriod
148148
) external virtual onlyOwner {
149149
require(operatorSetsEnabled, OperatorSetsNotEnabled());
@@ -814,7 +814,7 @@ contract SlashingRegistryCoordinator is
814814
function _createQuorum(
815815
OperatorSetParam memory operatorSetParams,
816816
uint96 minimumStake,
817-
IStakeRegistry.StrategyParams[] memory strategyParams,
817+
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
818818
IStakeRegistryTypes.StakeType stakeType,
819819
uint32 lookAheadPeriod
820820
) internal {

test/integration/IntegrationConfig.t.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "forge-std/Test.sol";
66
import "test/integration/IntegrationDeployer.t.sol";
77
import "test/ffi/util/G2Operations.sol";
88
import "test/integration/utils/BitmapStrings.t.sol";
9+
import {ISlashingRegistryCoordinatorTypes} from "../../src/interfaces/ISlashingRegistryCoordinator.sol";
910

1011
contract Constants {
1112
/// IECDSAStakeRegistryTypes.Quorum Config:
@@ -319,7 +320,7 @@ contract IntegrationConfig is IntegrationDeployer, G2Operations, Constants {
319320
for (uint256 i = 0; i < churnQuorums.length; i++) {
320321
uint8 quorum = uint8(churnQuorums[i]);
321322

322-
ISlashingRegistryCoordinator.OperatorSetParam memory params =
323+
IRegistryCoordinatorTypes.OperatorSetParam memory params =
323324
registryCoordinator.getOperatorSetParams(quorum);
324325

325326
// Sanity check - make sure we're at the operator cap
@@ -366,15 +367,15 @@ contract IntegrationConfig is IntegrationDeployer, G2Operations, Constants {
366367
/// From RegistryCoordinator._individualKickThreshold
367368
function _individualKickThreshold(
368369
uint96 operatorStake,
369-
ISlashingRegistryCoordinator.OperatorSetParam memory setParams
370+
IRegistryCoordinatorTypes.OperatorSetParam memory setParams
370371
) internal pure returns (uint96) {
371372
return operatorStake * setParams.kickBIPsOfOperatorStake / BIPS_DENOMINATOR;
372373
}
373374

374375
/// From RegistryCoordinator._totalKickThreshold
375376
function _totalKickThreshold(
376377
uint96 totalStake,
377-
ISlashingRegistryCoordinator.OperatorSetParam memory setParams
378+
IRegistryCoordinatorTypes.OperatorSetParam memory setParams
378379
) internal pure returns (uint96) {
379380
return totalStake * setParams.kickBIPsOfTotalStake / BIPS_DENOMINATOR;
380381
}
@@ -567,7 +568,7 @@ contract IntegrationConfig is IntegrationDeployer, G2Operations, Constants {
567568
* @return The number of operators to register
568569
*/
569570
function _randInitialOperators(
570-
ISlashingRegistryCoordinator.OperatorSetParam memory operatorSet
571+
IRegistryCoordinatorTypes.OperatorSetParam memory operatorSet
571572
) private returns (uint256) {
572573
uint256 fillTypeFlag = _randValue(fillTypeFlags);
573574

test/unit/EjectionManagerUnit.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
IEjectionManagerErrors,
99
IEjectionManagerTypes
1010
} from "../../src/interfaces/IEjectionManager.sol";
11+
import {IRegistryCoordinatorTypes} from "../../src/interfaces/IRegistryCoordinator.sol";
1112
import "../utils/MockAVSDeployer.sol";
1213

1314
contract EjectionManagerUnitTests is MockAVSDeployer {

test/unit/OperatorStateRetrieverUnit.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity ^0.8.27;
33

44
import "../utils/MockAVSDeployer.sol";
55
import {IStakeRegistryErrors} from "../../src/interfaces/IStakeRegistry.sol";
6+
import {IRegistryCoordinatorTypes} from "../../src/interfaces/IRegistryCoordinator.sol";
67

78
contract OperatorStateRetrieverUnitTests is MockAVSDeployer {
89
using BN254 for BN254.G1Point;

test/unit/RegistryCoordinatorUnit.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
IRegistryCoordinatorTypes,
99
IRegistryCoordinatorErrors
1010
} from "../../src/interfaces/ISlashingRegistryCoordinator.sol";
11+
import {IBLSApkRegistryTypes} from "../../src/interfaces/IBLSApkRegistry.sol";
1112
import {QuorumBitmapHistoryLib} from "../../src/libraries/QuorumBitmapHistoryLib.sol";
1213
import {BitmapUtils} from "../../src/libraries/BitmapUtils.sol";
1314
import {console} from "forge-std/console.sol";

test/unit/SlashingRegistryCoordinatorUnit.t.sol

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
// // emitted when an operator's index in the orderd operator list for the quorum with number `quorumNumber` is updated
4747
// event QuorumIndexUpdate(bytes32 indexed operatorId, uint8 quorumNumber, uint32 newIndex);
4848

49-
// event OperatorSetParamsUpdated(uint8 indexed quorumNumber, ISlashingRegistryCoordinator.OperatorSetParam operatorSetParams);
49+
// event OperatorSetParamsUpdated(uint8 indexed quorumNumber, IRegistryCoordinatorTypes.OperatorSetParam operatorSetParams);
5050

5151
// event ChurnApproverUpdated(address prevChurnApprover, address newChurnApprover);
5252

@@ -203,9 +203,9 @@
203203
// }
204204

205205
// function test_createQuorum_revert_notOwner() public {
206-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams;
206+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams;
207207
// uint96 minimumStake;
208-
// IStakeRegistry.StrategyParams[] memory strategyParams;
208+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams;
209209

210210
// cheats.expectRevert("Ownable: caller is not the owner");
211211
// cheats.prank(defaultOperator);
@@ -217,16 +217,16 @@
217217
// // this is necessary since the default setup already configures the max number of quorums, preventing adding more
218218
// _deployMockEigenLayerAndAVS(0);
219219

220-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams =
221-
// ISlashingRegistryCoordinator.OperatorSetParam({
220+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams =
221+
// IRegistryCoordinatorTypes.OperatorSetParam({
222222
// maxOperatorCount: defaultMaxOperatorCount,
223223
// kickBIPsOfOperatorStake: defaultKickBIPsOfOperatorStake,
224224
// kickBIPsOfTotalStake: defaultKickBIPsOfTotalStake
225225
// });
226226
// uint96 minimumStake = 1;
227-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
227+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
228228
// strategyParams[0] =
229-
// IStakeRegistry.StrategyParams({
229+
// IStakeRegistryTypes.StrategyParams({
230230
// strategy: IStrategy(address(1000)),
231231
// multiplier: 1e16
232232
// });
@@ -1902,14 +1902,14 @@
19021902
// function test_CreateTotalDelegatedStakeQuorum() public {
19031903
// _deployMockEigenLayerAndAVS(0);
19041904
// // Set up test params
1905-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
1905+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
19061906
// maxOperatorCount: 10,
19071907
// kickBIPsOfOperatorStake: 0,
19081908
// kickBIPsOfTotalStake: 0
19091909
// });
19101910
// uint96 minimumStake = 100;
1911-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
1912-
// strategyParams[0] = IStakeRegistry.StrategyParams({
1911+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
1912+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
19131913
// strategy: IStrategy(address(0x1)),
19141914
// multiplier: 1000
19151915
// });
@@ -1929,22 +1929,22 @@
19291929
// assertEq(registryCoordinator.quorumCount(), initialQuorumCount + 1);
19301930

19311931
// // Verify quorum params were set correctly
1932-
// ISlashingRegistryCoordinator.OperatorSetParam memory storedParams = registryCoordinator.getOperatorSetParams(initialQuorumCount);
1932+
// IRegistryCoordinatorTypes.OperatorSetParam memory storedParams = registryCoordinator.getOperatorSetParams(initialQuorumCount);
19331933
// assertEq(storedParams.maxOperatorCount, operatorSetParams.maxOperatorCount);
19341934
// assertEq(storedParams.kickBIPsOfOperatorStake, operatorSetParams.kickBIPsOfOperatorStake);
19351935
// assertEq(storedParams.kickBIPsOfTotalStake, operatorSetParams.kickBIPsOfTotalStake);
19361936
// }
19371937

19381938
// function test_CreateSlashableStakeQuorum_Reverts() public {
19391939
// _deployMockEigenLayerAndAVS(0);
1940-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
1940+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
19411941
// maxOperatorCount: 10,
19421942
// kickBIPsOfOperatorStake: 0,
19431943
// kickBIPsOfTotalStake: 0
19441944
// });
19451945
// uint96 minimumStake = 100;
1946-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
1947-
// strategyParams[0] = IStakeRegistry.StrategyParams({
1946+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
1947+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
19481948
// strategy: IStrategy(address(0x1)),
19491949
// multiplier: 1000
19501950
// });
@@ -2059,14 +2059,14 @@
20592059
// registryCoordinator.enableOperatorSets();
20602060

20612061
// // Create quorum params
2062-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2062+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
20632063
// maxOperatorCount: 10,
20642064
// kickBIPsOfOperatorStake: 1000,
20652065
// kickBIPsOfTotalStake: 100
20662066
// });
20672067
// uint96 minimumStake = 100;
2068-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2069-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2068+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2069+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
20702070
// strategy: IStrategy(address(1)),
20712071
// multiplier: 1
20722072
// });
@@ -2091,14 +2091,14 @@
20912091
// registryCoordinator.enableOperatorSets();
20922092

20932093
// // Create quorum params
2094-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2094+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
20952095
// maxOperatorCount: 10,
20962096
// kickBIPsOfOperatorStake: 1000,
20972097
// kickBIPsOfTotalStake: 100
20982098
// });
20992099
// uint96 minimumStake = 100;
2100-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2101-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2100+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2101+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
21022102
// strategy: IStrategy(address(1)),
21032103
// multiplier: 10000
21042104
// });
@@ -2121,15 +2121,15 @@
21212121
// registryCoordinator.enableOperatorSets();
21222122

21232123
// // Create quorum params
2124-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2124+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
21252125
// maxOperatorCount: 10,
21262126
// kickBIPsOfOperatorStake: 1000,
21272127
// kickBIPsOfTotalStake: 100
21282128
// });
21292129

21302130
// uint96 minimumStake = 100;
2131-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2132-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2131+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2132+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
21332133
// strategy: IStrategy(address(1)),
21342134
// multiplier: 10000
21352135
// });
@@ -2167,15 +2167,15 @@
21672167
// registryCoordinator.enableOperatorSets();
21682168

21692169
// // Create quorum params
2170-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2170+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
21712171
// maxOperatorCount: 10,
21722172
// kickBIPsOfOperatorStake: 1000,
21732173
// kickBIPsOfTotalStake: 100
21742174
// });
21752175

21762176
// uint96 minimumStake = 100;
2177-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2178-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2177+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2178+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
21792179
// strategy: IStrategy(address(1)),
21802180
// multiplier: 10000
21812181
// });
@@ -2226,15 +2226,15 @@
22262226
// vm.skip(true);
22272227
// _deployMockEigenLayerAndAVS(0);
22282228

2229-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2229+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
22302230
// maxOperatorCount: defaultMaxOperatorCount,
22312231
// kickBIPsOfOperatorStake: defaultKickBIPsOfOperatorStake,
22322232
// kickBIPsOfTotalStake: defaultKickBIPsOfTotalStake
22332233
// });
22342234

22352235
// uint96 minimumStake = 100;
2236-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2237-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2236+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2237+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
22382238
// strategy: IStrategy(address(1)),
22392239
// multiplier: 10000
22402240
// });
@@ -2259,15 +2259,15 @@
22592259
// registryCoordinator.enableOperatorSets();
22602260

22612261
// // Create quorum params
2262-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2262+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
22632263
// maxOperatorCount: 10,
22642264
// kickBIPsOfOperatorStake: 1000,
22652265
// kickBIPsOfTotalStake: 100
22662266
// });
22672267

22682268
// uint96 minimumStake = 100;
2269-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2270-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2269+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2270+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
22712271
// strategy: IStrategy(address(1)),
22722272
// multiplier: 10000
22732273
// });
@@ -2311,15 +2311,15 @@
23112311
// registryCoordinator.enableOperatorSets();
23122312

23132313
// // Create quorum params
2314-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2314+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
23152315
// maxOperatorCount: 10,
23162316
// kickBIPsOfOperatorStake: 1000,
23172317
// kickBIPsOfTotalStake: 100
23182318
// });
23192319

23202320
// uint96 minimumStake = 100;
2321-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2322-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2321+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2322+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
23232323
// strategy: IStrategy(address(1)),
23242324
// multiplier: 10000
23252325
// });
@@ -2358,15 +2358,15 @@
23582358
// registryCoordinator.enableOperatorSets();
23592359

23602360
// // Create quorum params
2361-
// ISlashingRegistryCoordinator.OperatorSetParam memory operatorSetParams = ISlashingRegistryCoordinator.OperatorSetParam({
2361+
// IRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams = IRegistryCoordinatorTypes.OperatorSetParam({
23622362
// maxOperatorCount: 10,
23632363
// kickBIPsOfOperatorStake: 1000,
23642364
// kickBIPsOfTotalStake: 100
23652365
// });
23662366

23672367
// uint96 minimumStake = 100;
2368-
// IStakeRegistry.StrategyParams[] memory strategyParams = new IStakeRegistry.StrategyParams[](1);
2369-
// strategyParams[0] = IStakeRegistry.StrategyParams({
2368+
// IStakeRegistryTypes.StrategyParams[] memory strategyParams = new IStakeRegistryTypes.StrategyParams[](1);
2369+
// strategyParams[0] = IStakeRegistryTypes.StrategyParams({
23702370
// strategy: IStrategy(address(1)),
23712371
// multiplier: 10000
23722372
// });

0 commit comments

Comments
 (0)