Skip to content

Commit 5efdb5c

Browse files
chfastmarioevz
authored andcommitted
new(tests): add state test with empty 7702 authorization list (ethereum#1224)
* new(tests): add state test with empty 7702 authorization list * fix(clis): Add exception to EELS --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
1 parent 8166434 commit 5efdb5c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/ethereum_clis/clis/execution_specs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ class ExecutionSpecsExceptionMapper(ExceptionMapper):
130130
@property
131131
def _mapping_data(self):
132132
return [
133+
ExceptionMessage(
134+
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST,
135+
"Failed transaction: InvalidBlock()",
136+
),
133137
ExceptionMessage(
134138
TransactionException.TYPE_4_TX_CONTRACT_CREATION,
135139
"Failed transaction: ",

tests/prague/eip7702_set_code_tx/test_set_code_txs.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,6 +2879,28 @@ def test_contract_create(
28792879
)
28802880

28812881

2882+
def test_empty_authorization_list(
2883+
state_test: StateTestFiller,
2884+
pre: Alloc,
2885+
):
2886+
"""Test sending an invalid transaction with empty authorization list."""
2887+
tx = Transaction(
2888+
gas_limit=100_000,
2889+
to=pre.deploy_contract(code=b""),
2890+
value=0,
2891+
authorization_list=[],
2892+
error=TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST,
2893+
sender=pre.fund_eoa(),
2894+
)
2895+
2896+
state_test(
2897+
env=Environment(),
2898+
pre=pre,
2899+
tx=tx,
2900+
post={},
2901+
)
2902+
2903+
28822904
@pytest.mark.parametrize(
28832905
"self_sponsored",
28842906
[

0 commit comments

Comments
 (0)