Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
test(contracts): input too large
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli committed Jun 26, 2023
1 parent 0308f24 commit 65bad98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions onchain/rollups/test/foundry/inputs/InputBox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ contract InputBoxTest is Test {
assertEq(inputBox.getNumberOfInputs(_dapp), 0);
}

function testAddLargeInput() public {
address dapp = vm.addr(1);

inputBox.addInput(dapp, new bytes(CanonicalMachine.INPUT_MAX_SIZE));

vm.expectRevert(LibInput.InputSizeExceedsLimit.selector);
inputBox.addInput(dapp, new bytes(CanonicalMachine.INPUT_MAX_SIZE + 1));
}

// fuzz testing with multiple inputs
function testAddInput(address _dapp, bytes[] calldata _inputs) public {
uint256 numInputs = _inputs.length;
Expand Down

0 comments on commit 65bad98

Please sign in to comment.