Skip to content

test_blobhash_opcode_contexts()

Documentation for tests/cancun/eip4844_blobs/test_blobhash_opcode_contexts.py::test_blobhash_opcode_contexts@49a16fac.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_blobhash_opcode_contexts.py::test_blobhash_opcode_contexts --fork Prague

Tests that the BLOBHASH opcode functions correctly when called in different contexts.

  • BLOBHASH opcode on the top level of the call stack.
  • BLOBHASH opcode on the max value.
  • BLOBHASH opcode on CALL, DELEGATECALL, STATICCALL, and CALLCODE.
  • BLOBHASH opcode on Initcode.
  • BLOBHASH opcode on CREATE and CREATE2.
  • BLOBHASH opcode on transaction types 0, 1 and 2.
Source code in tests/cancun/eip4844_blobs/test_blobhash_opcode_contexts.py
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
@pytest.mark.compile_yul_with("Shanghai")
def test_blobhash_opcode_contexts(opcode_context, blockchain_test: BlockchainTestFiller):
    """
    Tests that the `BLOBHASH` opcode functions correctly when called in different contexts.

    - `BLOBHASH` opcode on the top level of the call stack.
    - `BLOBHASH` opcode on the max value.
    - `BLOBHASH` opcode on `CALL`, `DELEGATECALL`, `STATICCALL`, and `CALLCODE`.
    - `BLOBHASH` opcode on Initcode.
    - `BLOBHASH` opcode on `CREATE` and `CREATE2`.
    - `BLOBHASH` opcode on transaction types 0, 1 and 2.
    """
    blockchain_test(
        pre=opcode_context.get("pre"),
        blocks=[Block(txs=[opcode_context.get("tx")])],
        post=opcode_context.get("post"),
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) opcode_context
...opcode_context_on_top_level_call_stack-fork_Cancun-blockchain_test on_top_level_call_stack
...opcode_context_on_top_level_call_stack-fork_Prague-blockchain_test on_top_level_call_stack
...opcode_context_on_top_level_call_stack-fork_Osaka-blockchain_test on_top_level_call_stack
...opcode_context_on_max_value-fork_Cancun-blockchain_test on_max_value
...opcode_context_on_max_value-fork_Prague-blockchain_test on_max_value
...opcode_context_on_max_value-fork_Osaka-blockchain_test on_max_value
...opcode_context_on_CALL-fork_Cancun-blockchain_test on_CALL
...opcode_context_on_CALL-fork_Prague-blockchain_test on_CALL
...opcode_context_on_CALL-fork_Osaka-blockchain_test on_CALL
...opcode_context_on_DELEGATECALL-fork_Cancun-blockchain_test on_DELEGATECALL
...opcode_context_on_DELEGATECALL-fork_Prague-blockchain_test on_DELEGATECALL
...opcode_context_on_DELEGATECALL-fork_Osaka-blockchain_test on_DELEGATECALL
...opcode_context_on_STATICCALL-fork_Cancun-blockchain_test on_STATICCALL
...opcode_context_on_STATICCALL-fork_Prague-blockchain_test on_STATICCALL
...opcode_context_on_STATICCALL-fork_Osaka-blockchain_test on_STATICCALL
...opcode_context_on_CALLCODE-fork_Cancun-blockchain_test on_CALLCODE
...opcode_context_on_CALLCODE-fork_Prague-blockchain_test on_CALLCODE
...opcode_context_on_CALLCODE-fork_Osaka-blockchain_test on_CALLCODE
...opcode_context_on_CREATE-fork_Cancun-blockchain_test on_CREATE
...opcode_context_on_CREATE-fork_Prague-blockchain_test on_CREATE
...opcode_context_on_CREATE-fork_Osaka-blockchain_test on_CREATE
...opcode_context_on_CREATE2-fork_Cancun-blockchain_test on_CREATE2
...opcode_context_on_CREATE2-fork_Prague-blockchain_test on_CREATE2
...opcode_context_on_CREATE2-fork_Osaka-blockchain_test on_CREATE2
...opcode_context_on_type_2_tx-fork_Cancun-blockchain_test on_type_2_tx
...opcode_context_on_type_2_tx-fork_Prague-blockchain_test on_type_2_tx
...opcode_context_on_type_2_tx-fork_Osaka-blockchain_test on_type_2_tx
...opcode_context_on_type_1_tx-fork_Cancun-blockchain_test on_type_1_tx
...opcode_context_on_type_1_tx-fork_Prague-blockchain_test on_type_1_tx
...opcode_context_on_type_1_tx-fork_Osaka-blockchain_test on_type_1_tx
...opcode_context_on_type_0_tx-fork_Cancun-blockchain_test on_type_0_tx
...opcode_context_on_type_0_tx-fork_Prague-blockchain_test on_type_0_tx
...opcode_context_on_type_0_tx-fork_Osaka-blockchain_test on_type_0_tx