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

Generate fixtures for these test cases for Prague with:

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

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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
@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,
):
    """
    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 case is only parametrized by fork.

Test ID (Abbreviated) timestamp valid_call valid_input tx_data
...fork_Cancun-blockchain_test-timestamp_12-valid_call_False-valid_input_False-zero_calldata 12 False False 00000000000000000000000000000000 00000000000000000000000000000000
...fork_Prague-blockchain_test-timestamp_12-valid_call_False-valid_input_False-zero_calldata 12 False False 00000000000000000000000000000000 00000000000000000000000000000000
...fork_Osaka-blockchain_test-timestamp_12-valid_call_False-valid_input_False-zero_calldata 12 False False 00000000000000000000000000000000 00000000000000000000000000000000