-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log filter by topic not working properly #725
Comments
It will only give you 4 blocks because it can only match the first topic. Topics shouldn't auto magic match on all topics. |
Actually the index parameter is always the same, though the first topic is always the signature except when its an anonymous function. But i guess the current way is still more valid. |
If you'd like to ignore specific fields use something like
|
ok, passing
|
You can now specify `null` as a way of saying "not interested in this topic, match all". core.Filter assumes the zero'd address to be the wildcard. JSON rpc assumes empty strings to be wildcards.
The problem persists. Now we don't get the "should be string" error anymore, as you "let" in e.g. i send: {"jsonrpc":"2.0","method":"eth_newFilter","params":[{
"fromBlock": '0x0',
"toBlock": 'latest',
"topics": [null, null, '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff']
}],"id":4} and would expect to get this log back: {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"topics": [
"0x0000000000000000000000000000000000000000000000000000000000000001",
"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
],
"data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9000000000000000000000000000000000000000000000000000000000000002a",
"blockNumber": 32,
"logIndex": 0,
"blockHash": "0xfa1f5bd36066b12b181d62caf8ec98c764beab18448e3b23beb351e9ae4b2d4e",
"transactionHash": "0xf9be3eaf451bc4a33e3f2f6451ea34771e93bbcd04b7ba34a6290a2edbef0ff3",
"transactionIndex": 0
} the same goes for an non-anonymous log, which has a signature at |
core: fixed wildcard topic filters. Closes #725
If i filter logs by topic and i provide the topics in the filter options not in the same order as the topics in the result logs, it doesn't match the log an therefor doesn't return it.
E.g. assuming you loaded the test blockchain from the test repo as follows:
If you call:
And then the
eth_getFilterLogs
with the filter id:You get 4 Logs back, even though 8 have that topic too.
See the full list of possible logs in this test chain:
The text was updated successfully, but these errors were encountered: