Skip to content

Commit 3bb9f6c

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 <[email protected]>
1 parent 2955b7a commit 3bb9f6c

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
@@ -132,6 +132,10 @@ class ExecutionSpecsExceptionMapper(ExceptionMapper):
132132
@property
133133
def _mapping_data(self):
134134
return [
135+
ExceptionMessage(
136+
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST,
137+
"Failed transaction: InvalidBlock()",
138+
),
135139
ExceptionMessage(
136140
TransactionException.TYPE_4_TX_CONTRACT_CREATION,
137141
"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
@@ -2930,6 +2930,28 @@ def test_contract_create(
29302930
)
29312931

29322932

2933+
def test_empty_authorization_list(
2934+
state_test: StateTestFiller,
2935+
pre: Alloc,
2936+
):
2937+
"""Test sending an invalid transaction with empty authorization list."""
2938+
tx = Transaction(
2939+
gas_limit=100_000,
2940+
to=pre.deploy_contract(code=b""),
2941+
value=0,
2942+
authorization_list=[],
2943+
error=TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST,
2944+
sender=pre.fund_eoa(),
2945+
)
2946+
2947+
state_test(
2948+
env=Environment(),
2949+
pre=pre,
2950+
tx=tx,
2951+
post={},
2952+
)
2953+
2954+
29332955
@pytest.mark.parametrize(
29342956
"self_sponsored",
29352957
[

0 commit comments

Comments
 (0)