From 65bad98eb931053585c8eae63a30fdee138a1567 Mon Sep 17 00:00:00 2001 From: Guilherme Dantas Date: Tue, 13 Jun 2023 17:52:25 -0300 Subject: [PATCH] test(contracts): input too large --- onchain/rollups/test/foundry/inputs/InputBox.t.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/onchain/rollups/test/foundry/inputs/InputBox.t.sol b/onchain/rollups/test/foundry/inputs/InputBox.t.sol index 4a52d515..e66b0a26 100644 --- a/onchain/rollups/test/foundry/inputs/InputBox.t.sol +++ b/onchain/rollups/test/foundry/inputs/InputBox.t.sol @@ -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;