Skip to content

test_calldata_lengths()

Documentation for tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_calldata_lengths@008e492e.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_calldata_lengths --fork Prague

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
@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.

Test ID (Abbreviated) timestamp valid_call valid_input tx_data
...fork_Cancun-blockchain_test-timestamp_12-valid_call_False-valid_input_False-empty_calldata 12 False False
...fork_Cancun-blockchain_test-timestamp_12-valid_call_False-valid_input_False-one_byte 12 False False 0c
...fork_Cancun-blockchain_test-timestamp_12-valid_call_False-valid_input_False-31_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000c
...fork_Cancun-blockchain_test-timestamp_12-valid_call_False-valid_input_False-33_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000000 0c
...fork_Cancun-blockchain_test-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
...fork_Prague-blockchain_test-timestamp_12-valid_call_False-valid_input_False-empty_calldata 12 False False
...fork_Prague-blockchain_test-timestamp_12-valid_call_False-valid_input_False-one_byte 12 False False 0c
...fork_Prague-blockchain_test-timestamp_12-valid_call_False-valid_input_False-31_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000c
...fork_Prague-blockchain_test-timestamp_12-valid_call_False-valid_input_False-33_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000000 0c
...fork_Prague-blockchain_test-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
...fork_Osaka-blockchain_test-timestamp_12-valid_call_False-valid_input_False-empty_calldata 12 False False
...fork_Osaka-blockchain_test-timestamp_12-valid_call_False-valid_input_False-one_byte 12 False False 0c
...fork_Osaka-blockchain_test-timestamp_12-valid_call_False-valid_input_False-31_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000c
...fork_Osaka-blockchain_test-timestamp_12-valid_call_False-valid_input_False-33_bytes 12 False False 00000000000000000000000000000000 00000000000000000000000000000000 0c
...fork_Osaka-blockchain_test-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