Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to post multiple batch in simple.sol #75

Merged
merged 8 commits into from
Dec 5, 2023
21 changes: 21 additions & 0 deletions src/mocks/Simple.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

pragma solidity ^0.8.0;

import "../bridge/ISequencerInbox.sol";
import "../precompiles/ArbRetryableTx.sol";
import "../precompiles/ArbSys.sol";

Expand Down Expand Up @@ -130,4 +131,24 @@ contract Simple {
to.staticcall{gas: before - 10000}(input);
return before - gasleft();
}

function postManyBatches(
ISequencerInbox sequencerInbox,
bytes memory batchData,
uint256 numberToPost
) external {
uint256 sequenceNumber = sequencerInbox.batchCount();
uint256 delayedMessagesRead = sequencerInbox.totalDelayedMessagesRead();
for (uint256 i = 0; i < numberToPost; i++) {
sequencerInbox.addSequencerL2Batch(
sequenceNumber,
batchData,
delayedMessagesRead,
IGasRefunder(address(0)),
0,
0
);
sequenceNumber++;
}
}
}