Skip to content

Commit de37130

Browse files
committed
feat(tests): EIP-7702, #8929 changes - Incomplete
1 parent e2a1cbb commit de37130

File tree

2 files changed

+28
-84
lines changed

2 files changed

+28
-84
lines changed

tests/prague/eip7702_set_code_tx/spec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ReferenceSpec:
1616
version: str
1717

1818

19-
ref_spec_7702 = ReferenceSpec("EIPS/eip-7702.md", "a6bf54ffc1506ed00f8234731684ccfe935ec9a3")
19+
ref_spec_7702 = ReferenceSpec("EIPS/eip-7702.md", "4334df83395693dc3f629bb43c18320d9e22e8c9")
2020

2121

2222
@dataclass(frozen=True)
@@ -28,7 +28,7 @@ class Spec:
2828

2929
SET_CODE_TX_TYPE = 0x04
3030
MAGIC = 0x05
31-
PER_AUTH_BASE_COST = 2_500
31+
PER_AUTH_BASE_COST = 15_000
3232
PER_EMPTY_ACCOUNT_COST = 25_000
3333
DELEGATION_DESIGNATION = bytes.fromhex("ef0100")
3434

tests/prague/eip7702_set_code_tx/test_set_code_txs.py

Lines changed: 26 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,40 +2106,10 @@ def test_set_code_using_chain_specific_id(
21062106
[
21072107
pytest.param(0, 1, 1, id="v=0,r=1,s=1"),
21082108
pytest.param(1, 1, 1, id="v=1,r=1,s=1"),
2109-
pytest.param(
2110-
2, 1, 1, id="v=2,r=1,s=1", marks=pytest.mark.xfail(reason="invalid signature")
2111-
),
2112-
pytest.param(
2113-
1, 0, 1, id="v=1,r=0,s=1", marks=pytest.mark.xfail(reason="invalid signature")
2114-
),
2115-
pytest.param(
2116-
1, 1, 0, id="v=1,r=1,s=0", marks=pytest.mark.xfail(reason="invalid signature")
2117-
),
2118-
pytest.param(
2119-
0,
2120-
SECP256K1N - 0,
2121-
1,
2122-
id="v=0,r=SECP256K1N,s=1",
2123-
marks=pytest.mark.xfail(reason="invalid signature"),
2124-
),
2125-
pytest.param(
2126-
0,
2127-
SECP256K1N - 1,
2128-
1,
2129-
id="v=0,r=SECP256K1N-1,s=1",
2130-
marks=pytest.mark.xfail(reason="invalid signature"),
2131-
),
21322109
pytest.param(0, SECP256K1N - 2, 1, id="v=0,r=SECP256K1N-2,s=1"),
21332110
pytest.param(1, SECP256K1N - 2, 1, id="v=1,r=SECP256K1N-2,s=1"),
21342111
pytest.param(0, 1, SECP256K1N_OVER_2, id="v=0,r=1,s=SECP256K1N_OVER_2"),
21352112
pytest.param(1, 1, SECP256K1N_OVER_2, id="v=1,r=1,s=SECP256K1N_OVER_2"),
2136-
pytest.param(
2137-
0,
2138-
1,
2139-
SECP256K1N_OVER_2 + 1,
2140-
id="v=0,r=1,s=SECP256K1N_OVER_2+1",
2141-
marks=pytest.mark.xfail(reason="invalid signature"),
2142-
),
21432113
],
21442114
)
21452115
def test_set_code_using_valid_synthetic_signatures(
@@ -2196,25 +2166,10 @@ def test_set_code_using_valid_synthetic_signatures(
21962166
@pytest.mark.parametrize(
21972167
"v,r,s",
21982168
[
2199-
pytest.param(2, 1, 1, id="v_2,r_1,s_1"),
2200-
pytest.param(
2201-
0,
2202-
1,
2203-
SECP256K1N_OVER_2 + 1,
2204-
id="v_0,r_1,s_SECP256K1N_OVER_2+1",
2205-
),
2206-
pytest.param(
2207-
2**256 - 1,
2208-
1,
2209-
1,
2210-
id="v_2**256-1,r_1,s_1",
2211-
),
2212-
pytest.param(
2213-
0,
2214-
1,
2215-
2**256 - 1,
2216-
id="v_0,r_1,s_2**256-1",
2217-
),
2169+
pytest.param(2**8, 1, 1, id="v=2**8"),
2170+
pytest.param(1, 2**256, 1, id="r=2**256"),
2171+
pytest.param(1, 1, 2**256, id="s=2**256"),
2172+
pytest.param(2**8, 2**256, 2**256, id="v=r=s=2**256"),
22182173
],
22192174
)
22202175
def test_invalid_tx_invalid_auth_signature(
@@ -2265,41 +2220,30 @@ def test_invalid_tx_invalid_auth_signature(
22652220
@pytest.mark.parametrize(
22662221
"v,r,s",
22672222
[
2268-
pytest.param(1, 0, 1, id="v_1,r_0,s_1"),
2269-
pytest.param(1, 1, 0, id="v_1,r_1,s_0"),
2270-
pytest.param(
2271-
0,
2272-
SECP256K1N,
2273-
1,
2274-
id="v_0,r_SECP256K1N,s_1",
2275-
),
2276-
pytest.param(
2277-
0,
2278-
SECP256K1N - 1,
2279-
1,
2280-
id="v_0,r_SECP256K1N-1,s_1",
2281-
),
2282-
pytest.param(
2283-
0,
2284-
1,
2285-
SECP256K1N_OVER_2,
2286-
id="v_0,r_1,s_SECP256K1N_OVER_2",
2287-
),
2288-
pytest.param(
2289-
0,
2290-
1,
2291-
SECP256K1N_OVER_2 - 1,
2292-
id="v_0,r_1,s_SECP256K1N_OVER_2_minus_one",
2293-
),
2294-
pytest.param(
2295-
1,
2296-
2**256 - 1,
2297-
1,
2298-
id="v_1,r_2**256-1,s_1",
2299-
),
2223+
# V
2224+
pytest.param(2, 1, 1, id="v=2"),
2225+
pytest.param(2**8 - 1, 1, 1, id="v=2**8-1"),
2226+
# R
2227+
pytest.param(1, 0, 1, id="r=0"),
2228+
pytest.param(0, SECP256K1N - 1, 1, id="r=SECP256K1N-1"),
2229+
pytest.param(0, SECP256K1N, 1, id="r=SECP256K1N"),
2230+
pytest.param(0, SECP256K1N + 1, 1, id="r=SECP256K1N+1"),
2231+
pytest.param(1, 2**256 - 1, 1, id="r=2**256-1"),
2232+
# S
2233+
pytest.param(1, 1, 0, id="s=0"),
2234+
pytest.param(0, 1, SECP256K1N_OVER_2 - 1, id="s=SECP256K1N_OVER_2-1"),
2235+
pytest.param(0, 1, SECP256K1N_OVER_2, id="s=SECP256K1N_OVER_2"),
2236+
pytest.param(0, 1, SECP256K1N_OVER_2 + 1, id="s=SECP256K1N_OVER_2+1"),
2237+
pytest.param(0, 1, SECP256K1N - 1, id="s=SECP256K1N-1"),
2238+
pytest.param(0, 1, SECP256K1N, id="s=SECP256K1N"),
2239+
pytest.param(0, 1, SECP256K1N + 1, id="s=SECP256K1N+1"),
2240+
pytest.param(0, 1, 2**256 - 1, id="s=2**256-1"),
2241+
# All Values
2242+
pytest.param(0, 0, 0, id="v=r=s=0"),
2243+
pytest.param(2**256 - 1, 2**256 - 1, 2**256 - 1, id="v=r=s=2**256-1"),
23002244
],
23012245
)
2302-
def test_set_code_using_invalid_signatures(
2246+
def test_valid_tx_invalid_auth_signature(
23032247
state_test: StateTestFiller,
23042248
pre: Alloc,
23052249
v: int,

0 commit comments

Comments
 (0)