Skip to content

test_blobbasefee_before_fork()

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

Generate fixtures for these test cases for Osaka with:

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

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

Source code in tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
@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 case is only parametrized by fork and fixture format.

Test ID (Abbreviated) caller_pre_storage
...fork_Shanghai-state_test- {1: 1}
...fork_ShanghaiToCancunAtTime15k-blockchain_test_from_state_test- {1: 1}