-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: improve tests cases in avsregistry/reader
#307
Comments
I was reviewing these cases, and it seems that the problem is with the function getQuorumBitmapIndexAtBlockNumber(
mapping(bytes32 => IRegistryCoordinator.QuorumBitmapUpdate[]) storage self,
uint32 blockNumber,
bytes32 operatorId
) internal view returns (uint32 index) {
uint256 length = self[operatorId].length;
// Traverse the operator's bitmap history in reverse, returning the first index
// corresponding to an update made before or at `blockNumber`
for (uint256 i = 0; i < length; i++) {
index = uint32(length - i - 1);
if (self[operatorId][index].updateBlockNumber <= blockNumber) {
return index;
}
}
revert(
"RegistryCoordinator.getQuorumBitmapIndexAtBlockNumber: no bitmap update found for operatorId"
);
} Since we didn’t create or update bitmaps for the |
This was fixed by making a better test setup. First the operator is created with |
### What Changed? In `avsregistry/reader,` we are testing against Holesky. The idea is to run tests locally against Anvil. The method that constructs `avs_reader` has been modified. When making the change, it generated a problem in the tests and so a temporary fix was added. Related issue #307 ### Reviewer Checklist - [ ] New features are tested and documented - [ ] PR updates the changelog with a description of changes - [x] PR has one of the `changelog-X` labels (if applies) - [ ] Code deprecates any old functionality before removing it
We were previously testing the
avsregistry/reader
against Holesky. In a recent PR, the method that createavs_reader
was modified to use Anvil. This change caused issues in tests related to methods withblock_number
.I have added an assert error as a temporary fix for
test_get_operators_stake_in_quorums_at_block
test_get_operators_stake_in_quorums_at_block_operator_id
test_get_operators_stake_in_quorums_at_current_block
test_get_operators_stake_in_quorums_of_operator_at_current_block
test_get_operators_stake_in_quorums_of_operator_at_block
Example:
The goal is to create a more comprehensive test that ensures the function does not return an error and verifies that the returned value is correct.
The text was updated successfully, but these errors were encountered: