Skip to content

Commit

Permalink
test: update quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
stevennevins committed Dec 18, 2024
1 parent f9c8ee8 commit bb05b30
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
- name: Run Forge build
run: |
forge --version
forge build --sizes
forge build --sizes --skip script --skip test --via-ir
id: build

- name: Run tests
shell: bash
run: |
forge test --no-match-contract FFI
forge test --no-match-contract FFI --via-ir
env:
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
Expand Down
32 changes: 31 additions & 1 deletion test/unit/OperatorLib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,36 @@ contract OperatorLibTest is Test {
);
vm.stopPrank();
}

// Fast forward 10 blocks
vm.roll(block.number + 10);

// Get all registered operators and sort them
address[][] memory registeredOperators = new address[][](1);
registeredOperators[0] = new address[](5);
for (uint256 i = 0; i < 5; i++) {
registeredOperators[0][i] = operators[i].key.addr;
}

// Sort operator addresses in ascending order
for (uint256 i = 0; i < registeredOperators[0].length - 1; i++) {
for (uint256 j = 0; j < registeredOperators[0].length - i - 1; j++) {
if (registeredOperators[0][j] > registeredOperators[0][j + 1]) {
address temp = registeredOperators[0][j];
registeredOperators[0][j] = registeredOperators[0][j + 1];
registeredOperators[0][j + 1] = temp;
}
}
}

// Update operators for quorum 1
bytes memory quorumNumbers = new bytes(1);
quorumNumbers[0] = bytes1(uint8(1)); // Quorum 1

vm.prank(middlewareConfig.admin);
RegistryCoordinator(middlewareDeployment.registryCoordinator).updateOperatorsForQuorum(
registeredOperators,
quorumNumbers
);
}
}

0 comments on commit bb05b30

Please sign in to comment.