Skip to content

test_calldata_lengths()

Documentation for tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_calldata_lengths@verkle@v0.0.6.

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_calldata_lengths --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Cancun:

fill -v tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_calldata_lengths --until=Cancun

Tests the beacon root contract call using multiple invalid input lengths.

Source code in tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@pytest.mark.parametrize(
    "tx_data",
    [
        pytest.param(bytes(), id="empty_calldata"),
        pytest.param(int.to_bytes(12, length=1, byteorder="big"), id="one_byte"),
        pytest.param(int.to_bytes(12, length=31, byteorder="big"), id="31_bytes"),
        pytest.param(int.to_bytes(12, length=33, byteorder="big"), id="33_bytes"),
        pytest.param(int.to_bytes(12, length=1024, byteorder="big"), id="1024_bytes"),
    ],
)
@pytest.mark.parametrize("valid_call,valid_input", [(False, False)])
@pytest.mark.parametrize("timestamp", [12])
@pytest.mark.valid_from("Cancun")
def test_calldata_lengths(
    blockchain_test: BlockchainTestFiller,
    beacon_root: bytes,
    timestamp: int,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
):
    """
    Tests the beacon root contract call using multiple invalid input lengths.
    """
    blockchain_test(
        pre=pre,
        blocks=[Block(txs=[tx], parent_beacon_block_root=beacon_root, timestamp=timestamp)],
        post=post,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID timestamp valid_call valid_input tx_data
timestamp_12-valid_call_False-valid_input_False-empty_calldata 12 False False
timestamp_12-valid_call_False-valid_input_False-one_byte 12 False False 0c
timestamp_12-valid_call_False-valid_input_False-31_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000c
timestamp_12-valid_call_False-valid_input_False-33_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000000 0c
timestamp_12-valid_call_False-valid_input_False-1024_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 0000000000000000000000000000000c