Skip to content

Commit 4a5a6f9

Browse files
committed
connect_provider to connect
1 parent 5ca4cd2 commit 4a5a6f9

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ let scanner = EventScanner::latest()
128128

129129
**Global Configuration Options:**
130130
- `block_read_limit(usize)` – Sets the maximum number of blocks to process per read operation. This prevents RPC provider errors from overly large block range queries.
131-
- Connect with `connect_ws::<Ethereum>(url)`, `connect_ipc::<Ethereum>(path)`, or `connect_provider(provider)`.
131+
- Connect with `connect_ws::<Ethereum>(url)`, `connect_ipc::<Ethereum>(path)`, or `connect(provider)`.
132132

133133
**Mode-specific APIs:**
134134
- Live: `client.stream()` – Start streaming new blocks

src/block_range_scanner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl BlockRangeScanner {
191191
) -> TransportResult<ConnectedBlockRangeScanner<N>> {
192192
let provider =
193193
RootProvider::<N>::new(ClientBuilder::default().ws(WsConnect::new(ws_url)).await?);
194-
self.connect_provider(provider)
194+
self.connect(provider)
195195
}
196196

197197
/// Connects to the provider via IPC
@@ -204,15 +204,15 @@ impl BlockRangeScanner {
204204
ipc_path: String,
205205
) -> TransportResult<ConnectedBlockRangeScanner<N>> {
206206
let provider = RootProvider::<N>::new(ClientBuilder::default().ipc(ipc_path.into()).await?);
207-
self.connect_provider(provider)
207+
self.connect(provider)
208208
}
209209

210210
/// Connects to an existing provider
211211
///
212212
/// # Errors
213213
///
214214
/// Returns an error if the connection fails
215-
pub fn connect_provider<N: Network>(
215+
pub fn connect<N: Network>(
216216
self,
217217
provider: RootProvider<N>,
218218
) -> TransportResult<ConnectedBlockRangeScanner<N>> {

src/event_lib/modes/historic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ impl HistoricScannerConfig {
9090
/// # Errors
9191
///
9292
/// Returns an error if the connection fails
93-
pub fn connect_provider<N: Network>(
93+
pub fn connect<N: Network>(
9494
self,
9595
provider: RootProvider<N>,
9696
) -> TransportResult<HistoricEventScanner<N>> {
9797
let HistoricScannerConfig { base, from_block, to_block } = self;
98-
let brs = base.block_range_scanner.connect_provider::<N>(provider)?;
98+
let brs = base.block_range_scanner.connect::<N>(provider)?;
9999
let config = HistoricScannerConfig { base, from_block, to_block };
100100
Ok(HistoricEventScanner { config, inner: EventScannerService::from_config(brs) })
101101
}

src/event_lib/modes/latest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl LatestScannerConfig {
149149
/// # Errors
150150
///
151151
/// Returns an error if the connection fails
152-
pub fn connect_provider<N: Network>(
152+
pub fn connect<N: Network>(
153153
self,
154154
provider: RootProvider<N>,
155155
) -> TransportResult<LatestEventScanner<N>> {
@@ -161,7 +161,7 @@ impl LatestScannerConfig {
161161
block_confirmations,
162162
switch_to_live,
163163
} = self;
164-
let brs = base.block_range_scanner.connect_provider::<N>(provider)?;
164+
let brs = base.block_range_scanner.connect::<N>(provider)?;
165165
let config = LatestScannerConfig {
166166
base,
167167
count,

src/event_lib/modes/live.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ impl LiveScannerConfig {
7777
/// # Errors
7878
///
7979
/// Returns an error if the connection fails
80-
pub fn connect_provider<N: Network>(
80+
pub fn connect<N: Network>(
8181
self,
8282
provider: RootProvider<N>,
8383
) -> TransportResult<LiveEventScanner<N>> {
8484
let LiveScannerConfig { base, block_confirmations } = self;
85-
let brs = base.block_range_scanner.connect_provider::<N>(provider)?;
85+
let brs = base.block_range_scanner.connect::<N>(provider)?;
8686
let config = LiveScannerConfig { base, block_confirmations };
8787
Ok(LiveEventScanner { config, inner: EventScannerService::from_config(brs) })
8888
}

src/event_lib/modes/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ impl SyncScannerConfig {
9090
/// # Errors
9191
///
9292
/// Returns an error if the connection fails
93-
pub fn connect_provider<N: Network>(
93+
pub fn connect<N: Network>(
9494
self,
9595
provider: RootProvider<N>,
9696
) -> TransportResult<SyncEventScanner<N>> {
9797
let SyncScannerConfig { base, from_block, block_confirmations } = self;
98-
let brs = base.block_range_scanner.connect_provider::<N>(provider)?;
98+
let brs = base.block_range_scanner.connect::<N>(provider)?;
9999
let config = SyncScannerConfig { base, from_block, block_confirmations };
100100
Ok(SyncEventScanner { config, inner: EventScannerService::from_config(brs) })
101101
}

0 commit comments

Comments
 (0)