-
Notifications
You must be signed in to change notification settings - Fork 69
feat(core): add uninstall filter to cli #3224
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(core): add uninstall filter to cli #3224
Conversation
Signed-off-by: Sacha Froment <[email protected]>
c7a1ab5
to
a1bcb32
Compare
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.
Pull Request Overview
Introduces an uninstall_filter
method to the Ethereum RPC client for completeness and adds corresponding error handling types.
- Adds
uninstall_filter
RPC call inEthClient
- Defines
UninstallFilterError
enum and integrates it intoEthClientError
- Updates imports to include the new error type
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
crates/networking/rpc/clients/eth/mod.rs | Added uninstall_filter method |
crates/networking/rpc/clients/eth/errors.rs | Introduced UninstallFilterError enum and updated EthClientError |
Comments suppressed due to low confidence (3)
crates/networking/rpc/clients/eth/mod.rs:1264
- Wrapping the filter ID inside a JSON string may not match the RPC spec if a numeric parameter is expected; verify whether
eth_uninstallFilter
requires a hex string or raw number and adjust accordingly.
params: Some(vec![json!(format!("{filter_id:#x}"))]),
crates/networking/rpc/clients/eth/mod.rs:1259
- [nitpick] Public methods should include a doc comment describing the purpose, parameters, and return value for clarity in the public API.
pub async fn uninstall_filter(&self, filter_id: u64) -> Result<bool, EthClientError> {
crates/networking/rpc/clients/eth/mod.rs:1259
- I don’t see any unit tests covering this new method; please add tests for both the success path and error scenarios.
pub async fn uninstall_filter(&self, filter_id: u64) -> Result<bool, EthClientError> {
let request = RpcRequest { | ||
id: RpcRequestId::Number(1), |
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.
Using a hardcoded request ID of 1 may cause collisions when multiple requests are in flight; consider generating a unique ID per call or using a shared atomic counter.
let request = RpcRequest { | |
id: RpcRequestId::Number(1), | |
let unique_id = self.request_id_counter.fetch_add(1, Ordering::SeqCst); | |
let request = RpcRequest { | |
id: RpcRequestId::Number(unique_id), |
Copilot uses AI. Check for mistakes.
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.
dunno
Motivation
Make the cli more complete
Description
simply add the call to uninstall filter
Closes #issue_number
Quick Q which scope shall I use ?