Skip to content

Commit

Permalink
fix: add missing _finalizePoppedL1Messages in ScrollChainMockFinalize…
Browse files Browse the repository at this point in the history
… contract
  • Loading branch information
zimpha committed Jul 30, 2024
1 parent 79bc0f9 commit da5a1df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mocks/ScrollChainMockFinalize.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ contract ScrollChainMockFinalize is ScrollChain {
if (_postStateRoot == bytes32(0)) revert ErrorStateRootIsZero();

// compute pending batch hash and verify
(, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader);
(, bytes32 _batchHash, uint256 _batchIndex, uint256 _totalL1MessagesPoppedOverall) = _loadBatchHeader(
_batchHeader
);
if (_batchIndex <= lastFinalizedBatchIndex) revert ErrorBatchIsAlreadyVerified();

// store in state
Expand All @@ -73,6 +75,9 @@ contract ScrollChainMockFinalize is ScrollChain {
finalizedStateRoots[_batchIndex] = _postStateRoot;
withdrawRoots[_batchIndex] = _withdrawRoot;

// Pop finalized and non-skipped message from L1MessageQueue.
_finalizePoppedL1Messages(_totalL1MessagesPoppedOverall);

emit FinalizeBatch(_batchIndex, _batchHash, _postStateRoot, _withdrawRoot);
}
}

0 comments on commit da5a1df

Please sign in to comment.