Skip to content

Commit c725bc1

Browse files
committed
Add test to verify client consistency with None topic args
1 parent e00740e commit c725bc1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

web3/utils/module_testing/eth_module.py

+28
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,37 @@ def assert_contains_log(result):
718718
"fromBlock": 0,
719719
"address": emitter_contract_address,
720720
}
721+
# Test with topic arguments
722+
723+
# Test with None event sig
724+
filter_params = {
725+
"fromBlock": 0,
726+
"topics": [None,
727+
'0x000000000000000000000000000000000000000000000000000000000000d431'],
728+
}
729+
730+
result = web3.eth.getLogs(filter_params)
731+
assert_contains_log(result)
732+
733+
# Test with None indexed arg
734+
filter_params = {
735+
"fromBlock": 0,
736+
"topics": ['0x057bc32826fbe161da1c110afcdcae7c109a8b69149f727fc37a603c60ef94ca',
737+
None],
738+
}
721739
result = web3.eth.getLogs(filter_params)
722740
assert_contains_log(result)
723741

742+
# Test with None overflowing
743+
filter_params = {
744+
"fromBlock": 0,
745+
"topics": [None, None, None],
746+
}
747+
748+
result = web3.eth.getLogs(filter_params)
749+
assert len(result) == 0
750+
import pdb; pdb.set_trace()
751+
724752
def test_eth_call_old_contract_state(self, web3, math_contract, unlocked_account):
725753
start_block = web3.eth.getBlock('latest')
726754
block_num = start_block.number

0 commit comments

Comments
 (0)