Skip to content

test_no_evm_execution()

Documentation for tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_no_evm_execution@21fb11c8.

Generate fixtures for these test cases for Prague with:

fill -v tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_no_evm_execution --fork Prague

Test Withdrawals don't trigger EVM execution.

Source code in tests/shanghai/eip4895_withdrawals/test_withdrawals.py
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
def test_no_evm_execution(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
):
    """Test Withdrawals don't trigger EVM execution."""
    sender = pre.fund_eoa()
    contracts = [pre.deploy_contract(Op.SSTORE(Op.NUMBER, 1)) for _ in range(4)]
    blocks = [
        Block(
            txs=[
                Transaction(
                    sender=sender,
                    gas_limit=100000,
                    to=contracts[2],
                ),
                Transaction(
                    sender=sender,
                    gas_limit=100000,
                    to=contracts[3],
                ),
            ],
            withdrawals=[
                Withdrawal(
                    index=0,
                    validator_index=0,
                    address=contracts[0],
                    amount=1,
                ),
                Withdrawal(
                    index=1,
                    validator_index=1,
                    address=contracts[1],
                    amount=1,
                ),
            ],
        ),
        Block(
            txs=[
                Transaction(
                    sender=sender,
                    gas_limit=100000,
                    to=contracts[0],
                ),
                Transaction(
                    sender=sender,
                    gas_limit=100000,
                    to=contracts[1],
                ),
            ],
            withdrawals=[
                Withdrawal(
                    index=0,
                    validator_index=0,
                    address=contracts[2],
                    amount=1,
                ),
                Withdrawal(
                    index=1,
                    validator_index=1,
                    address=contracts[3],
                    amount=1,
                ),
            ],
        ),
    ]

    post = {
        contracts[0]: Account(storage={2: 1}),
        contracts[1]: Account(storage={2: 1}),
        contracts[2]: Account(storage={1: 1}),
        contracts[3]: Account(storage={1: 1}),
    }

    blockchain_test(pre=pre, post=post, blocks=blocks)

Parametrized Test Cases

This test case is only parametrized by fork.

Test ID (Abbreviated)
...fork_Shanghai-blockchain_test
...fork_Cancun-blockchain_test
...fork_Prague-blockchain_test
...fork_Osaka-blockchain_test