Skip to content

Test Tstorage Execution Contexts

Documentation for tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py.

Generate fixtures for these test cases with:

fill -v tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py
Tests for EIP-1153: Transient Storage

Test cases for TSTORE and TLOAD opcode calls in different execution contexts.

test_subcall(state_test, env, pre, tx, post)

Test transient storage with a subcall using the following opcodes:

  • CALL
  • CALLCODE
  • DELEGATECALL
  • STATICCALL
Source code in tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
@CallContextTestCases.parametrize()
def test_subcall(
    state_test: StateTestFiller,
    env: Environment,
    pre: Mapping,
    tx: Transaction,
    post: Mapping,
):
    """
    Test transient storage with a subcall using the following opcodes:

    - `CALL`
    - `CALLCODE`
    - `DELEGATECALL`
    - `STATICCALL`
    """
    state_test(env=env, pre=pre, post=post, tx=tx)