mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 16:48:13 -05:00
fix: Update Return Type for eth_getFilterLogs function as per standard schema (#4323)
This commit is contained in:
@@ -23,7 +23,7 @@ pub trait EthFilterApi {
|
||||
|
||||
/// Returns all logs matching given filter (in a range 'from' - 'to').
|
||||
#[method(name = "getFilterLogs")]
|
||||
async fn filter_logs(&self, id: FilterId) -> RpcResult<Vec<Log>>;
|
||||
async fn filter_logs(&self, id: FilterId) -> RpcResult<FilterChanges>;
|
||||
|
||||
/// Uninstalls filter.
|
||||
#[method(name = "uninstallFilter")]
|
||||
|
||||
@@ -135,7 +135,7 @@ where
|
||||
/// Returns an error if no matching log filter exists.
|
||||
///
|
||||
/// Handler for `eth_getFilterLogs`
|
||||
pub async fn filter_logs(&self, id: FilterId) -> Result<Vec<Log>, FilterError> {
|
||||
pub async fn filter_logs(&self, id: FilterId) -> Result<FilterChanges, FilterError> {
|
||||
let filter = {
|
||||
let filters = self.inner.active_filters.inner.lock().await;
|
||||
if let FilterKind::Log(ref filter) =
|
||||
@@ -148,7 +148,8 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
self.inner.logs_for_filter(filter).await
|
||||
let logs = self.inner.logs_for_filter(filter).await?;
|
||||
Ok(FilterChanges::Logs(logs))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +188,7 @@ where
|
||||
/// Returns an error if no matching log filter exists.
|
||||
///
|
||||
/// Handler for `eth_getFilterLogs`
|
||||
async fn filter_logs(&self, id: FilterId) -> RpcResult<Vec<Log>> {
|
||||
async fn filter_logs(&self, id: FilterId) -> RpcResult<FilterChanges> {
|
||||
trace!(target: "rpc::eth", "Serving eth_getFilterLogs");
|
||||
Ok(EthFilter::filter_logs(self, id).await?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user