Skip to content

test_blobbasefee_before_fork()

Documentation for tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py::test_blobbasefee_before_fork@2867859a.

Generate fixtures for these test cases for Cancun with:

fill -v tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py::test_blobbasefee_before_fork --fork Cancun

Tests that the BLOBBASEFEE opcode results on exception when called before the fork.

Source code in tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
@pytest.mark.parametrize("caller_pre_storage", [{1: 1}], ids=[""])
@pytest.mark.valid_at_transition_to("Cancun")
def test_blobbasefee_before_fork(
    state_test: StateTestFiller,
    pre: Alloc,
    caller_address: Address,
    callee_address: Address,
    tx: Transaction,
) -> None:
    """
    Tests that the BLOBBASEFEE opcode results on exception when called before
    the fork.
    """
    # Fork happens at timestamp 15_000
    timestamp = 7_500
    post = {
        caller_address: Account(
            storage={1: 0},
        ),
        callee_address: Account(
            balance=0,
        ),
    }
    state_test(
        env=Environment(
            timestamp=timestamp,
        ),
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.