Skip to content

Commit c24f742

Browse files
committed
feat: stream_from accepts value that can be converted to block number or tag
1 parent 1bf8cab commit c24f742

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/block_range_scanner.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,16 @@ impl BlockRangeScannerClient {
878878
/// * `BlockRangeScannerError::ServiceShutdown` - if the service is already shutting down.
879879
pub async fn stream_from(
880880
&self,
881-
start_height: BlockNumberOrTag,
881+
start_height: impl Into<BlockNumberOrTag>,
882882
) -> Result<ReceiverStream<BlockRangeMessage>, BlockRangeScannerError> {
883883
let (blocks_sender, blocks_receiver) = mpsc::channel(MAX_BUFFERED_MESSAGES);
884884
let (response_tx, response_rx) = oneshot::channel();
885885

886-
let command =
887-
Command::StreamFrom { sender: blocks_sender, start_height, response: response_tx };
886+
let command = Command::StreamFrom {
887+
sender: blocks_sender,
888+
start_height: start_height.into(),
889+
response: response_tx,
890+
};
888891

889892
self.command_sender
890893
.send(command)

0 commit comments

Comments
 (0)