Skip to content

Commit ebc15e2

Browse files
committed
feat(tests): Deposit contract log with no topics
1 parent c3e5260 commit ebc15e2

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

tests/prague/eip6110_deposits/test_modified_contract.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@
8989
),
9090
],
9191
)
92+
@pytest.mark.parametrize("extra_event_type", ["transfer_log", "no_topics"])
9293
def test_extra_logs(
9394
blockchain_test: BlockchainTestFiller,
9495
pre: Alloc,
9596
include_deposit_event: bool,
97+
extra_event_type: str,
9698
) -> None:
9799
"""
98100
Test deposit contract emitting more log event types than the ones in
@@ -127,16 +129,23 @@ def test_extra_logs(
127129
# "0x0000000000000000000000006885e36bfcb68cb383dfe90023a462c03bcb2ae5",
128130
# "0x00000000000000000000000080b5dc88c98e528bf9cb4b7f0f076ac41da24651"]
129131

130-
bytecode = Op.LOG3(
132+
if extra_event_type == "no_topics":
133+
# Log with no topics
134+
bytecode = Op.LOG0(
135+
0,
136+
32,
137+
)
138+
else:
131139
# ERC-20 token transfer log ERC-20 token transfers are LOG3, since the
132140
# topic, the sender, and receiver are all topics (the sender and
133141
# receiver are `indexed` in the solidity event)
134-
0,
135-
32,
136-
0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF,
137-
0x000000000000000000000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
138-
0x000000000000000000000000BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
139-
)
142+
bytecode = Op.LOG3(
143+
0,
144+
32,
145+
0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF,
146+
0x000000000000000000000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
147+
0x000000000000000000000000BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
148+
)
140149

141150
requests = Requests()
142151

0 commit comments

Comments
 (0)