Skip to content

Commit

Permalink
style: shorten state variable and function naming in stake registry
Browse files Browse the repository at this point in the history
  • Loading branch information
wadealexc committed Nov 2, 2023
1 parent 88abb15 commit 5cd0d96
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 170 deletions.
6 changes: 3 additions & 3 deletions src/BLSOperatorStateRetriever.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract BLSOperatorStateRetriever {
bytes32 operatorId = bytes32(operatorIds[j]);
operators[i][j] = Operator({
operatorId: operatorId,
stake: stakeRegistry.getStakeForOperatorIdForQuorumAtBlockNumber(operatorId, quorumNumber, blockNumber)
stake: stakeRegistry.getOperatorStakeAtBlockNumber(operatorId, quorumNumber, blockNumber)
});
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@ contract BLSOperatorStateRetriever {
// get the indices of the quorumBitmap updates for each of the operators in the nonSignerOperatorIds array
checkSignaturesIndices.nonSignerQuorumBitmapIndices = registryCoordinator.getQuorumBitmapIndicesAtBlockNumber(referenceBlockNumber, nonSignerOperatorIds);
// get the indices of the totalStake updates for each of the quorums in the quorumNumbers array
checkSignaturesIndices.totalStakeIndices = stakeRegistry.getTotalStakeIndicesByQuorumNumbersAtBlockNumber(referenceBlockNumber, quorumNumbers);
checkSignaturesIndices.totalStakeIndices = stakeRegistry.getTotalStakeIndicesAtBlockNumber(referenceBlockNumber, quorumNumbers);

checkSignaturesIndices.nonSignerStakeIndices = new uint32[][](quorumNumbers.length);
for (uint8 quorumNumberIndex = 0; quorumNumberIndex < quorumNumbers.length; quorumNumberIndex++) {
Expand All @@ -130,7 +130,7 @@ contract BLSOperatorStateRetriever {
// if the operator was a part of the quorum and the quorum is a part of the provided quorumNumbers
if ((nonSignerQuorumBitmap >> uint8(quorumNumbers[quorumNumberIndex])) & 1 == 1) {
// get the index of the stake update for the operator at the given blocknumber and quorum number
checkSignaturesIndices.nonSignerStakeIndices[quorumNumberIndex][numNonSignersForQuorum] = stakeRegistry.getStakeUpdateIndexForOperatorIdForQuorumAtBlockNumber(
checkSignaturesIndices.nonSignerStakeIndices[quorumNumberIndex][numNonSignersForQuorum] = stakeRegistry.getStakeUpdateIndexForOperatorAtBlockNumber(
nonSignerOperatorIds[i],
uint8(quorumNumbers[quorumNumberIndex]),
referenceBlockNumber
Expand Down
6 changes: 3 additions & 3 deletions src/BLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
uint256 _initialPausedStatus,
OperatorSetParam[] memory _operatorSetParams,
uint96[] memory _minimumStakes,
IStakeRegistry.StrategyAndWeightingMultiplier[][] memory _strategyParams
IStakeRegistry.StrategyParams[][] memory _strategyParams
) external initializer {
require(
_operatorSetParams.length == _minimumStakes.length && _minimumStakes.length == _strategyParams.length,
Expand Down Expand Up @@ -307,7 +307,7 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
function createQuorum(
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistry.StrategyAndWeightingMultiplier[] memory strategyParams
IStakeRegistry.StrategyParams[] memory strategyParams
) external virtual onlyServiceManagerOwner {
_createQuorum(operatorSetParams, minimumStake, strategyParams);
}
Expand Down Expand Up @@ -490,7 +490,7 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
function _createQuorum(
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistry.StrategyAndWeightingMultiplier[] memory strategyParams
IStakeRegistry.StrategyParams[] memory strategyParams
) internal {
// Increment the total quorum count. Fails if we're already at the max
uint8 prevQuorumCount = quorumCount;
Expand Down
2 changes: 1 addition & 1 deletion src/BLSSignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
// if the nonSigner is a part of the quorum, subtract their stake from the running total
if (BitmapUtils.numberIsInBitmap(nonSignerQuorumBitmaps[i], quorumNumber)) {
quorumStakeTotals.signedStakeForQuorum[quorumNumberIndex] -=
stakeRegistry.getStakeForQuorumAtBlockNumberFromOperatorIdAndIndex(
stakeRegistry.getOperatorStakeAtBlockNumberAndIndex(
quorumNumber,
referenceBlockNumber,
nonSignerPubkeyHashes[i],
Expand Down
Loading

0 comments on commit 5cd0d96

Please sign in to comment.