Skip to content

test_transaction_validity_with_create2()

Documentation for tests/amsterdam/eip7976_increase_calldata_floor_cost/test_transaction_validity.py::test_transaction_validity_with_create2@87aba1a3.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7976_increase_calldata_floor_cost/test_transaction_validity.py::test_transaction_validity_with_create2 --fork Amsterdam

Test transaction validity for transactions calling a contract that uses CREATE2 internally. This verifies that internal contract creation via CREATE2 doesn't interfere with the floor gas cost mechanism.

Source code in tests/amsterdam/eip7976_increase_calldata_floor_cost/test_transaction_validity.py
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
@pytest.mark.parametrize(
    "ty",
    [pytest.param(0, id="type_0"), pytest.param(2, id="type_2")],
)
@pytest.mark.parametrize(
    "to",
    [
        pytest.param(
            Op.PUSH0
            + Op.PUSH0
            + Op.PUSH0
            + Op.PUSH0
            + Op.PUSH0
            + Op.PUSH0
            + Op.CREATE2
            + Op.STOP,
            id="contract_with_create2",
        ),
    ],
    indirect=True,
)
def test_transaction_validity_with_create2(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
) -> None:
    """
    Test transaction validity for transactions calling a contract that uses
    CREATE2 internally. This verifies that internal contract creation via
    CREATE2 doesn't interfere with the floor gas cost mechanism.
    """
    state_test(
        pre=pre,
        post={},
        tx=tx,
    )

Parametrized Test Cases

This test generates 12 parametrized test cases across 1 fork.