-
Notifications
You must be signed in to change notification settings - Fork 347
feat: add a method for an in-memory comparison between a Filter and Log #2179
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
base: main
Are you sure you want to change the base?
feat: add a method for an in-memory comparison between a Filter and Log #2179
Conversation
Please review @yash-atreya, I think tests can be improved (but let me know). |
Without certifying the accuracy of the function, this is the exact intent I had! Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, yeah I think we want this,
need some time to properly review this because filters give me headaches
/// | ||
/// Returns true if the Log matches the Filter, false otherwise. | ||
pub fn matches_log(&self, log: &RpcLog<LogData>) -> bool { | ||
// Check if block option matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's destructure self
here like let Self { a, b, c } = self
to make sure we're using all of the fields
Cloese: #1943
Added
matches_log
method that Adds ability to check if a Log matches a Filter entirely in memory, without requiring RPC calls. This is particularly useful when filtering logs from a single transaction that you already have in memory.@kayabaNerve do you think something like this is what was needed.
PR Checklist