Skip to content

Commit

Permalink
Generalized WhenL2
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Sep 20, 2024
1 parent c3184cd commit b1d194a
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 231 deletions.
18 changes: 6 additions & 12 deletions packages/protocol/contracts/governance/Election.sol
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,17 @@ contract Election is
* method.
* @return The list of elected validator signers.
*/
function electValidatorSigners() external view onlyL1 returns (address[] memory) {
function electValidatorSigners() external view returns (address[] memory) {
return electNValidatorSigners(electableValidators.min, electableValidators.max);
}

/**
* @notice Returns a list of elected validators with seats allocated to groups via the D'Hondt
* method.
* @return The list of elected validators.
*/
function electValidatorAccounts() external view onlyL2 returns (address[] memory) {
return electNValidator(electableValidators.min, electableValidators.max);
function electValidatorAccounts() external view returns (address[] memory) {
return electNValidatorAccounts(electableValidators.min, electableValidators.max);
}

/**
Expand Down Expand Up @@ -800,20 +801,13 @@ contract Election is
function electNValidatorSigners(
uint256 minElectableValidators,
uint256 maxElectableValidators
)
public
view
returns (
// TODO add tests this only works on L1 and L2
address[] memory
)
{
) public view returns (address[] memory) {
bool accounts = false;
return
_electNValidatorSignerOrAccount(minElectableValidators, maxElectableValidators, accounts);
}

function electNValidator(
function electNValidatorAccounts(
uint256 minElectableValidators,
uint256 maxElectableValidators
) public view returns (address[] memory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface IElection {
function electValidatorSigners() external view returns (address[] memory);
function electValidatorAccounts() external view returns (address[] memory);
function electNValidatorSigners(uint256, uint256) external view returns (address[] memory);
function electNValidator(uint256, uint256) external view returns (address[] memory);
function electNValidatorAccounts(uint256, uint256) external view returns (address[] memory);
function getElectableValidators() external view returns (uint256, uint256);
function getElectabilityThreshold() external view returns (uint256);
function getNumVotesReceivable(address) external view returns (uint256);
Expand Down
Loading

0 comments on commit b1d194a

Please sign in to comment.