test_system_contract_deployment()
Documentation for tests/prague/eip7002_el_triggerable_withdrawals/test_contract_deployment.py::test_system_contract_deployment@21507778.
Generate fixtures for these test cases for Prague with:
fill -v tests/prague/eip7002_el_triggerable_withdrawals/test_contract_deployment.py::test_system_contract_deployment --fork Prague
Verify calling the withdrawals system contract after deployment.
Source code in tests/prague/eip7002_el_triggerable_withdrawals/test_contract_deployment.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 | @pytest.mark.eels_base_coverage
@generate_system_contract_deploy_test(
fork=Prague,
tx_json_path=Path(realpath(__file__)).parent / "contract_deploy_tx.json",
expected_deploy_address=Address(Spec.WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS),
fail_on_empty_code=True,
)
def test_system_contract_deployment(
*,
fork: TransitionFork,
pre: Alloc,
**kwargs: Any,
) -> Generator[Block, None, None]:
"""Verify calling the withdrawals system contract after deployment."""
sender = pre.fund_eoa()
withdrawal_request = WithdrawalRequest(
validator_pubkey=0x01,
amount=1,
fee=Spec.get_fee(0),
source_address=sender,
)
intrinsic_gas_calculator = (
fork.transitions_to().transaction_intrinsic_cost_calculator()
)
test_transaction_gas = intrinsic_gas_calculator(
calldata=withdrawal_request.calldata
)
test_transaction = Transaction(
data=withdrawal_request.calldata,
gas_limit=test_transaction_gas * 10,
to=Spec.WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS,
sender=sender,
value=withdrawal_request.value,
)
yield Block(
txs=[test_transaction],
requests_hash=Requests(withdrawal_request),
)
|
Parametrized Test Cases
This test generates 6 parametrized test cases across 1 fork.