Skip to content

test_invalid_post_fork_block_without_bal_hash_field()

Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_fork_transition.py::test_invalid_post_fork_block_without_bal_hash_field@622620d8.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7928_block_level_access_lists/test_fork_transition.py::test_invalid_post_fork_block_without_bal_hash_field --fork Amsterdam

Reject an Amsterdam activation block whose header is missing block_access_list_hash.

The engine fixture sends newPayloadV5 with the blockAccessList param omitted, which must return -32602: Invalid params.

Source code in tests/amsterdam/eip7928_block_level_access_lists/test_fork_transition.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
@EIPChecklist.BlockHeaderField.Test.ForkTransition.After()
@pytest.mark.valid_at_transition_to("Amsterdam")
@pytest.mark.exception_test
def test_invalid_post_fork_block_without_bal_hash_field(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
) -> None:
    """
    Reject an Amsterdam activation block whose header is missing
    `block_access_list_hash`.

    The engine fixture sends `newPayloadV5` with the `blockAccessList`
    param omitted, which must return `-32602: Invalid params`.
    """
    sender = pre.fund_eoa()
    receiver = pre.fund_eoa(amount=0)

    tx = Transaction(sender=sender, to=receiver, value=100, gas_price=10)

    blockchain_test(
        pre=pre,
        post={},
        blocks=[
            Block(
                timestamp=FORK_TIMESTAMP,
                txs=[tx],
                rlp_modifier=Header(
                    block_access_list_hash=Header.REMOVE_FIELD,
                ),
                exception=BlockException.INVALID_BAL_HASH,
                engine_api_error_code=EngineAPIError.InvalidParams,
            ),
        ],
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.