Skip to content

test_access_list_data_cost_edge_cases()

Documentation for tests/amsterdam/eip7981_increase_access_list_cost/test_eip_mainnet.py::test_access_list_data_cost_edge_cases@9c2813ee.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7981_increase_access_list_cost/test_eip_mainnet.py::test_access_list_data_cost_edge_cases --fork Amsterdam

Test edge cases for access list data costs.

Tests include: - All zero bytes in access list - All non-zero bytes in access list

Source code in tests/amsterdam/eip7981_increase_access_list_cost/test_eip_mainnet.py
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
@pytest.mark.with_all_tx_types(selector=lambda tx_type: tx_type >= 1)
@pytest.mark.parametrize(
    "access_list",
    [
        pytest.param(
            [
                AccessList(
                    address=Address(0),
                    storage_keys=[Hash(0) for _ in range(10)],
                )
            ],
            id="all_zero_bytes",
        ),
        pytest.param(
            [
                AccessList(
                    address=Address(
                        0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                    ),
                    storage_keys=[
                        Hash(
                            0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                        )
                        for _ in range(5)
                    ],
                )
            ],
            id="all_nonzero_bytes",
        ),
    ],
)
@pytest.mark.parametrize(
    "to",
    [
        pytest.param("eoa", id=""),
    ],
    indirect=True,
)
def test_access_list_data_cost_edge_cases(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
) -> None:
    """
    Test edge cases for access list data costs.

    Tests include:
    - All zero bytes in access list
    - All non-zero bytes in access list
    """
    state_test(
        pre=pre,
        post={},
        tx=tx,
    )

Parametrized Test Cases

This test generates 8 parametrized test cases across 1 fork.