Skip to content

Commit

Permalink
chore: add test for partial proof
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind authored and just-mitch committed Feb 11, 2025
1 parent da391f8 commit 6eb2612
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions l1-contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,21 @@ contract RollupTest is RollupBase {
vm.warp(Timestamp.unwrap(rollup.getTimestampForSlot(Slot.wrap(_slot))));
}

function _testPrune() public setUpFor("mixed_block_1") {
function testPruneAfterPartial() public setUpFor("mixed_block_1") {
_proposeBlock("mixed_block_1", 1);
warpToL2Slot(rollup.getProofSubmissionWindow() - 1);
_proposeBlock("mixed_block_2", 2);

warpToL2Slot(rollup.getProofSubmissionWindow());
vm.expectRevert(abi.encodeWithSelector(Errors.Rollup__NothingToPrune.selector));
rollup.prune();

warpToL2Slot(rollup.getProofSubmissionWindow());
_proveBlocks("mixed_block_", 1, 1, address(this));

warpToL2Slot(rollup.getProofSubmissionWindow() + 1);
rollup.prune();

assertEq(rollup.getPendingBlockNumber(), 1);
assertEq(rollup.getProvenBlockNumber(), 1);
}

function testPrune() public setUpFor("mixed_block_1") {
Expand Down

0 comments on commit 6eb2612

Please sign in to comment.