Skip to content

Commit

Permalink
Added natspecs
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Dec 5, 2024
1 parent 6c9a6b1 commit 3c9d6cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/protocol/contracts-0.8/common/EpochManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ contract EpochManager is
function startNextEpochProcess() external nonReentrant onlySystemAlreadyInitialized {
require(isTimeForNextEpoch(), "Epoch is not ready to start");
require(
epochProcessing.status != EpochProcessStatus.Started,
epochProcessing.status == EpochProcessStatus.NotStarted,
"Epoch process is already started"
);
require(!isEpochProcessingStarted(), "Epoch process is already started");
Expand Down Expand Up @@ -600,10 +600,16 @@ contract EpochManager is
emit OracleAddressSet(newOracleAddress);
}

/**
* @return Whether epoch is being processed by individualy group by group.
*/
function isIndividualProcessing() public view returns (bool) {
return epochProcessing.status == EpochProcessStatus.IndivudualGroupsProcessing;
}

/**
* @return Whether epoch process has been started.
*/
function isEpochProcessingStarted() public view returns (bool) {
return isOnEpochProcess() || isIndividualProcessing();
}
Expand Down
5 changes: 5 additions & 0 deletions packages/protocol/test-sol/unit/common/EpochManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@ contract EpochManagerTest_setToProcessGroups is EpochManagerTest {
epochManager.startNextEpochProcess();
}

function test_Reverts_WhenSetToProcessGroups() public {
vm.expectRevert("Epoch process is not started");
epochManager.setToProcessGroups();
}

function test_setsGroupRewards() public {
(address[] memory groups, , ) = getGroupsWithLessersAndGreaters();
epochManager.startNextEpochProcess();
Expand Down

0 comments on commit 3c9d6cd

Please sign in to comment.