Skip to content

Test BLOBHASH Opcode

Documentation for tests/cancun/eip4844_blobs/test_blobhash_opcode.py@49c766fb.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_blobhash_opcode.py --fork Prague
Tests BLOBHASH opcode in EIP-4844: Shard Blob Transactions

Test cases for the BLOBHASH opcode in EIP-4844: Shard Blob Transactions.

Adding a new test

Add a function that is named test_<test_name> and takes at least the following arguments:

  • blockchain_test
  • pre
  • tx
  • post

Additional custom pytest.fixture fixtures can be added and parametrized for new test cases.

There is no specific structure to follow within this test module.

Test Functions Overview

Name Type Cases (Prague) Description
test_blobhash_gas_cost state_test 28 Tests BLOBHASH opcode gas cost using a variety of indexes.
test_blobhash_scenarios blockchain_test 4 Tests that the BLOBHASH opcode returns the correct versioned hash for
test_blobhash_invalid_blob_index blockchain_test 1 Tests that the BLOBHASH opcode returns a zeroed bytes32 value for invalid
test_blobhash_multiple_txs_in_block blockchain_test 1 Tests that the BLOBHASH opcode returns the appropriate values when there