Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests): add a test to check that a contract creating blob tx is invalid #330

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/cancun/eip4844_blobs/test_blob_txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
EngineAPIError,
Environment,
Header,
Initcode,
)
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools import (
Expand Down Expand Up @@ -1032,3 +1033,25 @@ def test_blob_type_tx_pre_fork(
blocks=blocks,
genesis_environment=Environment(), # `env` fixture has blob fields
)


@pytest.mark.valid_from("Cancun")
@pytest.mark.parametrize("destination_account", [None], ids=[""])
@pytest.mark.parametrize("tx_calldata", [Initcode(deploy_code=Op.SSTORE(0, 1))], ids=[""])
@pytest.mark.parametrize("tx_gas", [100_000], ids=[""])
@pytest.mark.parametrize("tx_error", ["contract creation not possible in blob tx"], ids=[""])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just made up this tx_error message (didn't find one). But, it could be that it's not checked/used due to the if in L279:

https://github.com/danceratopz/execution-spec-tests/blob/a9f31ffd803502b13043227589d517aaa128b0a3/tests/cancun/eip4844_blobs/test_blob_txs.py#L251-L279

def test_contract_creating_blob_type_tx(
blockchain_test: BlockchainTestFiller,
pre: Dict,
env: Environment,
blocks: List[Block],
):
"""
Test that a type 3 transaction that creates a contract is rejected.
"""
blockchain_test(
pre=pre,
post={},
blocks=blocks,
genesis_environment=env,
)
Loading