Add test_incorrect_blob_tx_type

This commit is contained in:
Hsiao-Wei Wang
2023-04-28 17:37:50 +08:00
parent 655094ee4a
commit 327ef095d0

View File

@@ -46,3 +46,20 @@ def test_one_blob(spec, state):
@spec_state_test
def test_max_blobs(spec, state):
yield from run_block_with_blobs(spec, state, blob_count=spec.MAX_BLOBS_PER_BLOCK)
@with_deneb_and_later
@spec_state_test
def test_incorrect_blob_tx_type(spec, state):
yield 'pre', state
block = build_empty_block_for_next_slot(spec, state)
opaque_tx, _, blob_kzg_commitments, _ = get_sample_opaque_tx(spec)
block.body.blob_kzg_commitments = blob_kzg_commitments
opaque_tx[0] == spec.uint8(0x04) # incorrect tx type
block.body.execution_payload.transactions = [opaque_tx]
block.body.execution_payload.block_hash = compute_el_block_hash(spec, block.body.execution_payload)
signed_block = state_transition_and_sign_block(spec, state, block)
yield 'blocks', [signed_block]
yield 'post', state