Skip to content

test_value_transfer_gas_calculation()

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

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py::test_value_transfer_gas_calculation --fork Amsterdam

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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
@pytest.mark.parametrize(
    "callee_opcode", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL]
)
@pytest.mark.parametrize("gas_shortage", [0, 1])
@pytest.mark.valid_from("London")
def test_value_transfer_gas_calculation(
    state_test: StateTestFiller,
    pre: Alloc,
    caller_tx: Transaction,
    post: Dict[str, Account],
    expected_block_access_list: BlockAccessListExpectation,
) -> 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,
        expected_block_access_list=expected_block_access_list,
    )

Parametrized Test Cases

This test generates 8 parametrized test cases across 7 forks.