Skip to content

Commit 43257b9

Browse files
committed
wip
1 parent aefb382 commit 43257b9

File tree

1 file changed

+80
-40
lines changed

1 file changed

+80
-40
lines changed

tests/frontier/opcodes/test_calldatasize.py

Lines changed: 80 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,87 @@
88

99

1010
@pytest.mark.parametrize(
11-
"mstore,args_size,code_for_address_a,tx_data,address_a_storage",
11+
"tx_data,storage",
1212
[
1313
(
14-
(Op.MSTORE8(offset=0x0, value=0x25) + Op.MSTORE8(offset=0x1, value=0x60)),
15-
0x2,
16-
(Op.PUSH1[0x0] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE),
17-
b"\x00",
18-
Account(
19-
storage={0x00: 0x2560000000000000000000000000000000000000000000000000000000000000}
20-
),
21-
),
22-
(
23-
(
24-
Op.MSTORE(
25-
offset=0x0,
26-
value=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,
27-
)
28-
+ Op.MSTORE8(offset=0x20, value=0x23)
29-
),
14+
(b"\x02", b"\x01"),
15+
Account(storage={0x00: 0x02}),
16+
),
17+
(
18+
(0x11, 1),
19+
Account(storage={0x00: 0x11}),
20+
),
21+
(
22+
(0x21, 1),
23+
Account(storage={0x00: 0x21}),
24+
),
25+
(
26+
(0x31, 1),
27+
Account(storage={0x00: 0x31}),
28+
),
29+
(
30+
(0x101, 1),
31+
Account(storage={0x00: 0x101}),
32+
),
33+
(
34+
0x02,
35+
Account(storage={0x00: 0x02}),
36+
),
37+
(
38+
0x11,
39+
Account(storage={0x00: 0x11}),
40+
),
41+
(
42+
0x21,
43+
Account(storage={0x00: 0x21}),
44+
),
45+
(
46+
0x31,
47+
Account(storage={0x00: 0x31}),
48+
),
49+
(
50+
0x101,
51+
Account(storage={0x00: 0x101}),
52+
),
53+
(
54+
0x02,
55+
Account(storage={0x00: 0x02}),
56+
),
57+
(
58+
0x11,
59+
Account(storage={0x00: 0x11}),
60+
),
61+
(
62+
0x21,
63+
Account(storage={0x00: 0x21}),
64+
),
65+
(
66+
0x31,
67+
Account(storage={0x00: 0x31}),
68+
),
69+
(
70+
0x101,
71+
Account(storage={0x00: 0x101}),
72+
),
73+
(
74+
0x02,
75+
Account(storage={0x00: 0x02}),
76+
),
77+
(
78+
0x11,
79+
Account(storage={0x00: 0x11}),
80+
),
81+
(
3082
0x21,
31-
(Op.PUSH1[0x1] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE + Op.STOP),
32-
b"\x01",
33-
Account(
34-
storage={0x00: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23}
35-
),
36-
),
37-
(
38-
(
39-
Op.MSTORE(
40-
offset=0x0,
41-
value=0x123456789ABCDEF0000000000000000000000000000000000000000000000000,
42-
)
43-
+ Op.MSTORE8(offset=0x20, value=0x0)
44-
+ Op.MSTORE8(offset=0x21, value=0x24)
45-
),
46-
0x22,
47-
(Op.PUSH1[0x5] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE + Op.STOP),
48-
b"\x02",
49-
Account(
50-
storage={0x00: 0xBCDEF00000000000000000000000000000000000000000000000000024000000}
51-
),
83+
Account(storage={0x00: 0x21}),
84+
),
85+
(
86+
0x31,
87+
Account(storage={0x00: 0x31}),
88+
),
89+
(
90+
0x101,
91+
Account(storage={0x00: 0x101}),
5292
),
5393
],
5494
ids=[
@@ -79,7 +119,7 @@ def test_calldataload(
79119
fork: Fork,
80120
tx_data: bytes,
81121
pre: Alloc,
82-
address_a_storage: Account,
122+
storage: Account,
83123
):
84124
"""
85125
Test `CALLDATASIZE` opcode.
@@ -112,5 +152,5 @@ def test_calldataload(
112152
to=to,
113153
value=0x01,
114154
)
115-
post = {address: address_a_storage}
155+
post = {address: storage}
116156
state_test(pre=pre, post=post, tx=tx)

0 commit comments

Comments
 (0)