Skip to content

test_invalid_beacon_root_calldata_value()

Documentation for tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_invalid_beacon_root_calldata_value@20373115.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_invalid_beacon_root_calldata_value --fork Amsterdam

Tests the beacon root contract call using invalid input values: - zero calldata.

Contract should revert.

Source code in tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
@pytest.mark.parametrize(
    "tx_data",
    [
        pytest.param(
            int.to_bytes(0, length=32, byteorder="big"), id="zero_calldata"
        ),
    ],
)
@pytest.mark.parametrize("valid_call,valid_input", [(False, False)])
@pytest.mark.parametrize("timestamp", [12])
@pytest.mark.valid_from("Cancun")
def test_invalid_beacon_root_calldata_value(
    blockchain_test: BlockchainTestFiller,
    beacon_root: bytes,
    timestamp: int,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Tests the beacon root contract call using invalid input values:
    - zero calldata.

    Contract should revert.
    """
    blockchain_test(
        pre=pre,
        blocks=[
            Block(
                txs=[tx],
                parent_beacon_block_root=beacon_root,
                timestamp=timestamp,
            )
        ],
        post=post,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 4 forks.