Skip to content

test_withdrawing_to_precompiles()

Documentation for tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_withdrawing_to_precompiles@83970623.

Generate fixtures for these test cases for Prague with:

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

Test withdrawing to all precompiles for a given fork.

Source code in tests/shanghai/eip4895_withdrawals/test_withdrawals.py
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
@pytest.mark.parametrize("amount", [0, 1])
@pytest.mark.with_all_precompiles
def test_withdrawing_to_precompiles(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    precompile: int,
    amount: int,
    t8n: TransitionTool,
):
    """Test withdrawing to all precompiles for a given fork."""
    sender = pre.fund_eoa()
    post: Dict = {}

    blocks = [
        # First block performs the withdrawal
        Block(
            withdrawals=[
                Withdrawal(
                    index=0,
                    validator_index=0,
                    address=Address(precompile),
                    amount=amount,
                )
            ]
        ),
        # Second block sends a transaction to the precompile
        Block(
            txs=[
                Transaction(
                    sender=sender,
                    gas_limit=100000,
                    to=Address(precompile),
                ),
            ],
        ),
    ]
    blockchain_test(pre=pre, post=post, blocks=blocks)

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) precompile amount
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_0 0x000000000000000000000000000000 0000000009 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_1 0x000000000000000000000000000000 0000000009 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_0 0x000000000000000000000000000000 0000000005 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_1 0x000000000000000000000000000000 0000000005 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_0 0x000000000000000000000000000000 0000000006 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_1 0x000000000000000000000000000000 0000000006 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_0 0x000000000000000000000000000000 0000000007 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_1 0x000000000000000000000000000000 0000000007 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_0 0x000000000000000000000000000000 0000000008 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_1 0x000000000000000000000000000000 0000000008 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_0 0x000000000000000000000000000000 0000000001 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_1 0x000000000000000000000000000000 0000000001 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_0 0x000000000000000000000000000000 0000000002 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_1 0x000000000000000000000000000000 0000000002 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_0 0x000000000000000000000000000000 0000000003 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_1 0x000000000000000000000000000000 0000000003 1
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_0 0x000000000000000000000000000000 0000000004 0
...fork_Shanghai-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_1 0x000000000000000000000000000000 0000000004 1
...fork_Cancun-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_0 0x000000000000000000000000000000 000000000a 0
...fork_Cancun-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_1 0x000000000000000000000000000000 000000000a 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_0 0x000000000000000000000000000000 0000000009 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_1 0x000000000000000000000000000000 0000000009 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_0 0x000000000000000000000000000000 0000000005 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_1 0x000000000000000000000000000000 0000000005 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_0 0x000000000000000000000000000000 0000000006 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_1 0x000000000000000000000000000000 0000000006 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_0 0x000000000000000000000000000000 0000000007 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_1 0x000000000000000000000000000000 0000000007 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_0 0x000000000000000000000000000000 0000000008 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_1 0x000000000000000000000000000000 0000000008 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_0 0x000000000000000000000000000000 0000000001 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_1 0x000000000000000000000000000000 0000000001 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_0 0x000000000000000000000000000000 0000000002 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_1 0x000000000000000000000000000000 0000000002 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_0 0x000000000000000000000000000000 0000000003 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_1 0x000000000000000000000000000000 0000000003 1
...fork_Cancun-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_0 0x000000000000000000000000000000 0000000004 0
...fork_Cancun-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_1 0x000000000000000000000000000000 0000000004 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000b-blockchain_test-amount_0 0x000000000000000000000000000000 000000000b 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000b-blockchain_test-amount_1 0x000000000000000000000000000000 000000000b 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000c-blockchain_test-amount_0 0x000000000000000000000000000000 000000000c 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000c-blockchain_test-amount_1 0x000000000000000000000000000000 000000000c 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000d-blockchain_test-amount_0 0x000000000000000000000000000000 000000000d 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000d-blockchain_test-amount_1 0x000000000000000000000000000000 000000000d 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000e-blockchain_test-amount_0 0x000000000000000000000000000000 000000000e 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000e-blockchain_test-amount_1 0x000000000000000000000000000000 000000000e 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000f-blockchain_test-amount_0 0x000000000000000000000000000000 000000000f 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000f-blockchain_test-amount_1 0x000000000000000000000000000000 000000000f 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000010-blockchain_test-amount_0 0x000000000000000000000000000000 0000000010 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000010-blockchain_test-amount_1 0x000000000000000000000000000000 0000000010 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000011-blockchain_test-amount_0 0x000000000000000000000000000000 0000000011 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000011-blockchain_test-amount_1 0x000000000000000000000000000000 0000000011 1
...fork_Prague-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_0 0x000000000000000000000000000000 000000000a 0
...fork_Prague-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_1 0x000000000000000000000000000000 000000000a 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_0 0x000000000000000000000000000000 0000000009 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_1 0x000000000000000000000000000000 0000000009 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_0 0x000000000000000000000000000000 0000000005 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_1 0x000000000000000000000000000000 0000000005 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_0 0x000000000000000000000000000000 0000000006 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_1 0x000000000000000000000000000000 0000000006 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_0 0x000000000000000000000000000000 0000000007 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_1 0x000000000000000000000000000000 0000000007 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_0 0x000000000000000000000000000000 0000000008 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_1 0x000000000000000000000000000000 0000000008 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_0 0x000000000000000000000000000000 0000000001 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_1 0x000000000000000000000000000000 0000000001 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_0 0x000000000000000000000000000000 0000000002 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_1 0x000000000000000000000000000000 0000000002 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_0 0x000000000000000000000000000000 0000000003 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_1 0x000000000000000000000000000000 0000000003 1
...fork_Prague-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_0 0x000000000000000000000000000000 0000000004 0
...fork_Prague-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_1 0x000000000000000000000000000000 0000000004 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000b-blockchain_test-amount_0 0x000000000000000000000000000000 000000000b 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000b-blockchain_test-amount_1 0x000000000000000000000000000000 000000000b 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000c-blockchain_test-amount_0 0x000000000000000000000000000000 000000000c 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000c-blockchain_test-amount_1 0x000000000000000000000000000000 000000000c 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000d-blockchain_test-amount_0 0x000000000000000000000000000000 000000000d 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000d-blockchain_test-amount_1 0x000000000000000000000000000000 000000000d 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000e-blockchain_test-amount_0 0x000000000000000000000000000000 000000000e 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000e-blockchain_test-amount_1 0x000000000000000000000000000000 000000000e 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000f-blockchain_test-amount_0 0x000000000000000000000000000000 000000000f 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000f-blockchain_test-amount_1 0x000000000000000000000000000000 000000000f 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000010-blockchain_test-amount_0 0x000000000000000000000000000000 0000000010 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000010-blockchain_test-amount_1 0x000000000000000000000000000000 0000000010 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000011-blockchain_test-amount_0 0x000000000000000000000000000000 0000000011 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000011-blockchain_test-amount_1 0x000000000000000000000000000000 0000000011 1
...fork_Osaka-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_0 0x000000000000000000000000000000 000000000a 0
...fork_Osaka-precompile_0x000000000000000000000000000000000000000a-blockchain_test-amount_1 0x000000000000000000000000000000 000000000a 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_0 0x000000000000000000000000000000 0000000009 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000009-blockchain_test-amount_1 0x000000000000000000000000000000 0000000009 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_0 0x000000000000000000000000000000 0000000005 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000005-blockchain_test-amount_1 0x000000000000000000000000000000 0000000005 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_0 0x000000000000000000000000000000 0000000006 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000006-blockchain_test-amount_1 0x000000000000000000000000000000 0000000006 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_0 0x000000000000000000000000000000 0000000007 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000007-blockchain_test-amount_1 0x000000000000000000000000000000 0000000007 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_0 0x000000000000000000000000000000 0000000008 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000008-blockchain_test-amount_1 0x000000000000000000000000000000 0000000008 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_0 0x000000000000000000000000000000 0000000001 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000001-blockchain_test-amount_1 0x000000000000000000000000000000 0000000001 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_0 0x000000000000000000000000000000 0000000002 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000002-blockchain_test-amount_1 0x000000000000000000000000000000 0000000002 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_0 0x000000000000000000000000000000 0000000003 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000003-blockchain_test-amount_1 0x000000000000000000000000000000 0000000003 1
...fork_Osaka-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_0 0x000000000000000000000000000000 0000000004 0
...fork_Osaka-precompile_0x0000000000000000000000000000000000000004-blockchain_test-amount_1 0x000000000000000000000000000000 0000000004 1