Skip to content

Commit bf94904

Browse files
committed
pass just calldata_offset, not all the code
1 parent 1c9444a commit bf94904

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/frontier/opcodes/test_calldataload.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99

1010
@pytest.mark.parametrize(
11-
"mstore,args_size,code_for_address_a,tx_data,address_a_storage",
11+
"mstore,args_size,calldata_offset,tx_data,address_a_storage",
1212
[
1313
(
1414
(Op.MSTORE8(offset=0x0, value=0x25) + Op.MSTORE8(offset=0x1, value=0x60)),
1515
0x2,
16-
(Op.PUSH1[0x0] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE),
16+
0x0,
1717
b"\x00",
1818
Account(
1919
storage={0x00: 0x2560000000000000000000000000000000000000000000000000000000000000}
@@ -28,7 +28,7 @@
2828
+ Op.MSTORE8(offset=0x20, value=0x23)
2929
),
3030
0x21,
31-
(Op.PUSH1[0x1] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE + Op.STOP),
31+
0x1,
3232
b"\x01",
3333
Account(
3434
storage={0x00: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23}
@@ -44,7 +44,7 @@
4444
+ Op.MSTORE8(offset=0x21, value=0x24)
4545
),
4646
0x22,
47-
(Op.PUSH1[0x5] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE + Op.STOP),
47+
0x5,
4848
b"\x02",
4949
Account(
5050
storage={0x00: 0xBCDEF00000000000000000000000000000000000000000000000000024000000}
@@ -61,7 +61,7 @@ def test_calldataload(
6161
state_test: StateTestFiller,
6262
mstore: Bytecode,
6363
args_size: int,
64-
code_for_address_a: Bytecode,
64+
calldata_offset: int,
6565
fork: Fork,
6666
tx_data: bytes,
6767
pre: Alloc,
@@ -72,7 +72,9 @@ def test_calldataload(
7272
7373
Based on https://github.com/ethereum/tests/blob/ae4791077e8fcf716136e70fe8392f1a1f1495fb/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml
7474
"""
75-
address_a = pre.deploy_contract(code_for_address_a)
75+
address_a = pre.deploy_contract(
76+
(Op.PUSH1[calldata_offset] + Op.CALLDATALOAD + Op.PUSH1[0x0] + Op.SSTORE + Op.STOP),
77+
)
7678

7779
address_b = pre.deploy_contract(
7880
mstore

0 commit comments

Comments
 (0)