-
Notifications
You must be signed in to change notification settings - Fork 36
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
Contract#logs should support filtering by indexed parameters #5
Comments
@hayeah Could you please more details for the issue? Thank you |
The RPC call to get contract logs is:
You can filter the logs by matching which topics you want. In the example, the
This is the lower EVM mechanism. Check the help message for the Solidity Event LogsSuppose we have a solidity event looking like this:
This event type would emit three topics: To filter by topics, the underlying RPC call expects the log parameter values to be ABI-encoded hexadecimal string. In the
And the library should convert that to a instance of ILogFilter. To do the ABI-conversion, you'll need to read the contract's ABI info (generated by the solidity compiler), which for an event looks something like this: {
"name": "emitFooEvent",
"type": "function",
"payable": false,
"inputs": [
{
"name": "a",
"type": "string",
"indexed": false
}
],
"outputs": [
{
"name": "",
"type": "string",
"indexed": false
}
],
"constant": false,
"anonymous": false
}, |
right now it's able to filter by raw ABI encoded hexadecimals.
would be nice to filter like:
Modify waitLogs
The text was updated successfully, but these errors were encountered: