Skip to content

test_valid_gas_limits_with_access_list()

Documentation for tests/amsterdam/eip7981_increase_access_list_cost/test_transaction_validity.py::test_valid_gas_limits_with_access_list@2119b382.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7981_increase_access_list_cost/test_transaction_validity.py::test_valid_gas_limits_with_access_list --fork Amsterdam

Test that transactions with sufficient gas are valid.

Tests various gas limit scenarios: - Exact intrinsic gas - Slightly more than intrinsic gas - Much more than intrinsic gas

Source code in tests/amsterdam/eip7981_increase_access_list_cost/test_transaction_validity.py
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@pytest.mark.with_all_tx_types(selector=lambda tx_type: tx_type >= 1)
@pytest.mark.parametrize(
    "access_list,tx_gas_delta",
    [
        pytest.param(
            [AccessList(address=Address(1), storage_keys=[Hash(0)])],
            0,
            id="exact_gas",
        ),
        pytest.param(
            [AccessList(address=Address(1), storage_keys=[Hash(0)])],
            1,
            id="one_extra_gas",
        ),
        pytest.param(
            [AccessList(address=Address(1), storage_keys=[Hash(0)])],
            1000,
            id="plenty_extra_gas",
        ),
    ],
)
@pytest.mark.parametrize(
    "to",
    [pytest.param("eoa", id="")],
    indirect=True,
)
def test_valid_gas_limits_with_access_list(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
) -> None:
    """
    Test that transactions with sufficient gas are valid.

    Tests various gas limit scenarios:
    - Exact intrinsic gas
    - Slightly more than intrinsic gas
    - Much more than intrinsic gas
    """
    state_test(
        pre=pre,
        post={},
        tx=tx,
    )

Parametrized Test Cases

This test generates 12 parametrized test cases across 1 fork.