Skip to content

Commit fe60984

Browse files
committed
feat: remove need for scanner from
1 parent 93b3236 commit fe60984

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/block_range_scanner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ impl<N: Network> Service<N> {
542542
}
543543
Err(e) => {
544544
error!(error = %e, "Terminal RPC call error, shutting down");
545-
_ = sender.try_stream(ScannerError::from(e)).await;
545+
_ = sender.try_stream(e).await;
546546
return;
547547
}
548548
};

src/event_scanner/scanner/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async fn handle_block_range<N: Network>(
246246
}
247247
Err(e) => {
248248
error!(error = ?e, "Received error message");
249-
if !sender.try_stream(ScannerError::from(e)).await {
249+
if !sender.try_stream(e).await {
250250
return false;
251251
}
252252
}

src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ impl<T: Clone> IntoScannerMessageResult<T> for ScannerMessage<T> {
4949
}
5050
}
5151

52-
impl<T: Clone> IntoScannerMessageResult<T> for ScannerError {
52+
impl<T: Clone, E: Into<ScannerError>> IntoScannerMessageResult<T> for E {
5353
fn into_scanner_message_result(self) -> Result<ScannerMessage<T>, ScannerError> {
54-
Err(self)
54+
Err(self.into())
5555
}
5656
}
5757

0 commit comments

Comments
 (0)