Skip to content

Commit

Permalink
Add test to verify client consistency with None topic args
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjw committed Aug 1, 2018
1 parent e00740e commit c725bc1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions web3/utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,37 @@ def assert_contains_log(result):
"fromBlock": 0,
"address": emitter_contract_address,
}
# Test with topic arguments

# Test with None event sig
filter_params = {
"fromBlock": 0,
"topics": [None,
'0x000000000000000000000000000000000000000000000000000000000000d431'],
}

result = web3.eth.getLogs(filter_params)
assert_contains_log(result)

# Test with None indexed arg
filter_params = {
"fromBlock": 0,
"topics": ['0x057bc32826fbe161da1c110afcdcae7c109a8b69149f727fc37a603c60ef94ca',
None],
}
result = web3.eth.getLogs(filter_params)
assert_contains_log(result)

# Test with None overflowing
filter_params = {
"fromBlock": 0,
"topics": [None, None, None],
}

result = web3.eth.getLogs(filter_params)
assert len(result) == 0
import pdb; pdb.set_trace()

def test_eth_call_old_contract_state(self, web3, math_contract, unlocked_account):
start_block = web3.eth.getBlock('latest')
block_num = start_block.number
Expand Down

0 comments on commit c725bc1

Please sign in to comment.