Skip to content

Test Tstorage Execution Contexts

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

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version
For all forks up to and including Cancun:
fill -v tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py --until=Cancun --evm-bin=/path/to/evm-tool-dev-version

abstract: Tests for EIP-1153: Transient Storage

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

test_subcall(state_test, env, pre, txs, 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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@CallContextTestCases.parametrize()
def test_subcall(
    state_test: StateTestFiller,
    env: Environment,
    pre: Mapping,
    txs: List[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, txs=txs)