Skip to content

test_block_gas_accounting_with_logs()

Documentation for tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_transaction_types.py::test_block_gas_accounting_with_logs@622620d8.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_transaction_types.py::test_block_gas_accounting_with_logs --fork Amsterdam

Verify transaction containing refunds that also emits a log.

Source code in tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_transaction_types.py
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@EIPChecklist.BlockLevelConstraint.Test.Content.Logs()
@pytest.mark.with_all_refund_types()
def test_block_gas_accounting_with_logs(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    fork: Fork,
    refund_type: RefundTypes,
) -> None:
    """
    Verify transaction containing refunds that also emits a log.
    """
    refund_tx = RefundTransaction.build(
        fork=fork,
        sender=pre.fund_eoa(INITIAL_FUND),
        refund_types={refund_type},
        refunds_count=REFUNDS_COUNT,
        emit_log=True,
    )
    refund_tx.set_pre(pre)

    blockchain_test(
        pre=pre,
        blocks=[
            Block(
                txs=[refund_tx],
                expected_gas_used=refund_tx.block_gas_used(),
            )
        ],
        post=refund_tx.post(pre),
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.