Skip to content

test_tx_to_beacon_root_contract()

Documentation for tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py::test_tx_to_beacon_root_contract@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

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

Tests the beacon root contract using a transaction with different types and data lengths.

Source code in tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
@pytest.mark.parametrize("auto_access_list", [False, True])
@pytest.mark.parametrize("call_beacon_root_contract", [True])
@pytest.mark.with_all_tx_types
@pytest.mark.valid_from("Cancun")
def test_tx_to_beacon_root_contract(
    blockchain_test: BlockchainTestFiller,
    beacon_root: bytes,
    timestamp: int,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Tests the beacon root contract using a transaction with different types and
    data lengths.
    """
    blockchain_test(
        pre=pre,
        blocks=[
            Block(
                txs=[tx],
                parent_beacon_block_root=beacon_root,
                timestamp=timestamp,
            )
        ],
        post=post,
    )

Parametrized Test Cases

This test generates 10 parametrized test cases across 4 forks.