Skip to content

Commit

Permalink
add nominate during nomination period also
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlescano committed Aug 24, 2023
1 parent 83c4d42 commit e1a0118
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ contract BaseElectionModule is
function nominate() public virtual override {
// TODO: onlyOnMothership?

Council.onlyInPeriod(Council.ElectionPeriod.Nomination);
Council.onlyInPeriods(Council.ElectionPeriod.Nomination, Council.ElectionPeriod.Vote);

SetUtil.AddressSet storage nominees = Council.load().getCurrentElection().nominees;

Expand Down
11 changes: 11 additions & 0 deletions protocol/governance/contracts/storage/Council.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ library Council {
}
}

/// @dev Used to allow certain functions to only operate within a given periods
function onlyInPeriods(
Council.ElectionPeriod period1,
Council.ElectionPeriod period2
) internal view {
Council.ElectionPeriod currentPeriod = Council.getCurrentPeriod(load());
if (currentPeriod != period1 && currentPeriod != period2) {
revert NotCallableInCurrentPeriod();
}
}

/// @dev Ensures epoch dates are in the correct order, durations are above minimums, etc
function validateEpochSchedule(
Data storage self,
Expand Down

0 comments on commit e1a0118

Please sign in to comment.