Skip to content

Commit 949a125

Browse files
author
pacrob
committed
snekcase async methods
1 parent a9fac74 commit 949a125

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tests/core/filtering/test_contract_get_logs.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_async_contract_get_available_events(
105105

106106

107107
@pytest.mark.asyncio
108-
async def test_async_contract_getLogs_all(
108+
async def test_async_contract_get_logs_all(
109109
async_w3,
110110
async_emitter,
111111
async_wait_for_transaction,
@@ -117,14 +117,14 @@ async def test_async_contract_getLogs_all(
117117
txn_hash = await contract.functions.logNoArgs(event_id).transact()
118118
await async_wait_for_transaction(async_w3, txn_hash)
119119

120-
contract_logs = await contract.events.LogNoArguments.getLogs()
120+
contract_logs = await contract.events.LogNoArguments.get_logs()
121121
log_entries = list(contract_logs)
122122
assert len(log_entries) == 1
123123
assert log_entries[0]["transactionHash"] == txn_hash
124124

125125

126126
@pytest.mark.asyncio
127-
async def test_async_contract_getLogs_range(
127+
async def test_async_contract_get_logs_range(
128128
async_w3,
129129
async_emitter,
130130
async_wait_for_transaction,
@@ -141,21 +141,25 @@ async def test_async_contract_getLogs_range(
141141
eth_block_number = await async_w3.eth.block_number
142142
assert eth_block_number == 3
143143

144-
contract_logs = await contract.events.LogNoArguments.getLogs()
144+
contract_logs = await contract.events.LogNoArguments.get_logs()
145145
log_entries = list(contract_logs)
146146
assert len(log_entries) == 1
147147

148-
contract_logs = await contract.events.LogNoArguments.getLogs(fromBlock=2, toBlock=3)
148+
contract_logs = await contract.events.LogNoArguments.get_logs(
149+
from_block=2, to_block=3
150+
)
149151
log_entries = list(contract_logs)
150152
assert len(log_entries) == 1
151153

152-
contract_logs = await contract.events.LogNoArguments.getLogs(fromBlock=1, toBlock=2)
154+
contract_logs = await contract.events.LogNoArguments.get_logs(
155+
from_block=1, to_block=2
156+
)
153157
log_entries = list(contract_logs)
154158
assert len(log_entries) == 0
155159

156160

157161
@pytest.mark.asyncio
158-
async def test_async_contract_getLogs_argument_filter(
162+
async def test_async_contract_get_logs_argument_filter(
159163
async_w3, async_emitter, async_wait_for_transaction, emitter_event_ids
160164
):
161165

@@ -181,19 +185,19 @@ async def test_async_contract_getLogs_argument_filter(
181185
for txn_hash in txn_hashes:
182186
await async_wait_for_transaction(async_w3, txn_hash)
183187

184-
all_logs = await contract.events.LogTripleWithIndex.getLogs(fromBlock=1)
188+
all_logs = await contract.events.LogTripleWithIndex.get_logs(from_block=1)
185189
assert len(all_logs) == 4
186190

187191
# Filter all entries where arg1 in (1, 2)
188-
partial_logs = await contract.events.LogTripleWithIndex.getLogs(
189-
fromBlock=1,
192+
partial_logs = await contract.events.LogTripleWithIndex.get_logs(
193+
from_block=1,
190194
argument_filters={"arg1": [1, 2]},
191195
)
192196
assert len(partial_logs) == 2
193197

194198
# Filter all entries where arg0 == 1
195-
partial_logs = await contract.events.LogTripleWithIndex.getLogs(
196-
fromBlock=1,
199+
partial_logs = await contract.events.LogTripleWithIndex.get_logs(
200+
from_block=1,
197201
argument_filters={"arg0": 1},
198202
)
199203
assert len(partial_logs) == 4

0 commit comments

Comments
 (0)