Skip to content

test_blobbasefee_before_fork()

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

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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@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.