Skip to content

test_builder_exit_contract_deployment()

Documentation for tests/amsterdam/eip8282_builder_execution_requests/test_contract_deployment.py::test_builder_exit_contract_deployment@2867859a.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8282_builder_execution_requests/test_contract_deployment.py::test_builder_exit_contract_deployment --fork Amsterdam

Verify calling the builder exit contract after deployment.

Source code in tests/amsterdam/eip8282_builder_execution_requests/test_contract_deployment.py
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@pytest.mark.eels_base_coverage
@generate_system_contract_deploy_test(
    fork=Amsterdam,
    factory_json_path=Path(realpath(__file__)).parent
    / "builder_exit_factory_deploy.json",
    expected_deploy_address=Address(Spec.BUILDER_EXIT_CONTRACT_ADDRESS),
    fail_on_empty_code=True,
)
def test_builder_exit_contract_deployment(
    *,
    fork: TransitionFork,
    pre: Alloc,
    **kwargs: Any,
) -> Generator[Block, None, None]:
    """Verify calling the builder exit contract after deployment."""
    sender = pre.fund_eoa()
    exit_request = BuilderExitRequest(
        pubkey=0x01,
        source_address=sender,
        fee=BuilderExitRequest.get_fee(0),
    )

    test_transaction = Transaction(
        data=exit_request.calldata,
        to=Spec.BUILDER_EXIT_CONTRACT_ADDRESS,
        sender=sender,
        value=exit_request.value,
    )

    yield Block(
        txs=[test_transaction],
        header_verify=Header(requests_hash=Requests(exit_request)),
    )

Parametrized Test Cases

This test generates 6 parametrized test cases across 1 fork.