Skip to content

test_value_transfer_gas_calculation_byzantium()

Documentation for tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py::test_value_transfer_gas_calculation_byzantium@b47f0253.

Generate fixtures for these test cases for Berlin with:

fill -v tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py::test_value_transfer_gas_calculation_byzantium --fork Berlin

Tests the nested CALL/CALLCODE/DELEGATECALL/STATICCALL opcode gas consumption with a positive value transfer.

Source code in tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
@pytest.mark.parametrize(
    "callee_opcode", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL]
)
@pytest.mark.parametrize("gas_shortage", [0, 1])
@pytest.mark.valid_from("Byzantium")
@pytest.mark.valid_until("Berlin")
@pytest.mark.eels_base_coverage
def test_value_transfer_gas_calculation_byzantium(
    state_test: StateTestFiller,
    pre: Alloc,
    caller_tx: Transaction,
    post: Dict[str, Account],
) -> None:
    """
    Tests the nested CALL/CALLCODE/DELEGATECALL/STATICCALL opcode gas
    consumption with a positive value transfer.
    """
    state_test(env=Environment(), pre=pre, post=post, tx=caller_tx)

Parametrized Test Cases

This test generates 8 parametrized test cases across 5 forks.