Closed m-Peter closed 1 month ago
The changes enhance error handling and validation in the log filtering process across several functions. The GetLogs
method now includes robust error checks for filter creation and matching operations. Additionally, the NewRangeFilter
and NewIDFilter
functions enforce limits on the number of topics, improving reliability. Test cases have been refined to ensure comprehensive coverage of these new validations, ensuring the integrity and robustness of the filtering mechanisms.
Files | Change Summary |
---|---|
api/api.go |
Improved error handling in GetLogs method: added checks for filter creation and matching errors. |
services/logs/filter.go |
Added validation for criteria.Topics length in NewRangeFilter and NewIDFilter ; updated function signatures to return errors. |
services/logs/filter_test.go |
Refactored test cases for clarity; expanded coverage for filtering scenarios and error conditions related to topics length. |
tests/web3js/eth_logs_filtering_test.js |
Adjusted getPastEvents function parameters for broader event retrieval; standardized formatting for setTimeout . |
Objective | Addressed | Explanation |
---|---|---|
Validate the topics length in eth_getLogs (##422) |
✅ |
🐇 In the code, we hop with glee,
Error handling now flows like a stream,
Topics are limited, no more than four,
Logs are safe, we can now explore!
With tests so bright, our paths are clear,
Robust and ready, we have naught to fear!
🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Very nice PR, will merge now.
Closes: https://github.com/onflow/flow-evm-gateway/issues/422
Description
In addition to the
topics
length validation, we also add more tests regarding the matching logic.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes
Tests