Skip to content

Commit

Permalink
++ test
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Sep 24, 2024
1 parent b4ddea7 commit 2379af0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/protocol/test-sol/devchain/e2e/common/EpochManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,32 @@ contract E2E_EpochManager_InitializeSystem is E2E_EpochManager {
assertEq(epochManager.firstKnownEpoch(), 42);
assertEq(epochManager.getCurrentEpochNumber(), 42);

assertTrue(epochManager.systemAlreadyInitialized());
}
}
contract E2E_EpochManager_GetCurrentEpoch is E2E_EpochManager {
function setUp() public override {
super.setUp();
whenL2(vm);
}

function test_Revert_WhenSystemNotInitialized() public {
vm.expectRevert("Epoch system not initialized");
(
uint256 firstBlock,
uint256 lastBlock,
uint256 startTimestamp,
uint256 rewardsBlock
) = epochManager.getCurrentEpoch();
}

function test_ReturnExpectedValues() public {
vm.prank(epochManagerEnabler);
epochManager.initializeSystem(42, 43, firstElected);

assertEq(epochManager.firstKnownEpoch(), 42);
assertEq(epochManager.getCurrentEpochNumber(), 42);

(
uint256 firstBlock,
uint256 lastBlock,
Expand Down

0 comments on commit 2379af0

Please sign in to comment.