Skip to content

test_eoa_init_as_pointer()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py::test_eoa_init_as_pointer@20373115.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py::test_eoa_init_as_pointer --fork Amsterdam

It was agreed before that senders don't have code.

And there were issues with tests sending transactions from account's with code With EIP7702 it is again possible, let's check the test runners are ok.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
@pytest.mark.valid_from("Prague")
def test_eoa_init_as_pointer(state_test: StateTestFiller, pre: Alloc) -> None:
    """
    It was agreed before that senders don't have code.

    And there were issues with tests sending transactions from account's
    with code With EIP7702 it is again possible,
    let's check the test runners are ok.
    """
    env = Environment()
    storage = Storage()
    contract = pre.deploy_contract(
        code=Op.SSTORE(storage.store_next(1, "code_worked"), 1)
    )
    sender = pre.fund_eoa(delegation=contract)

    tx = Transaction(
        to=sender,
        gas_limit=200_000,
        data=b"",
        value=0,
        sender=sender,
    )
    post = {sender: Account(storage=storage)}
    state_test(
        env=env,
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.