@@ -12,12 +12,6 @@ use crate::{
1212} ;
1313
1414impl EventScannerBuilder < LatestEvents > {
15- #[ must_use]
16- pub fn block_confirmations ( mut self , confirmations : u64 ) -> Self {
17- self . config . block_confirmations = confirmations;
18- self
19- }
20-
2115 /// Sets the starting block for the historic scan.
2216 ///
2317 /// # Note
@@ -168,10 +162,7 @@ impl<N: Network> EventScanner<LatestEvents, N> {
168162
169163#[ cfg( test) ]
170164mod tests {
171- use crate :: {
172- block_range_scanner:: DEFAULT_BLOCK_CONFIRMATIONS ,
173- event_scanner:: scanner:: DEFAULT_MAX_CONCURRENT_FETCHES ,
174- } ;
165+ use crate :: event_scanner:: scanner:: DEFAULT_MAX_CONCURRENT_FETCHES ;
175166
176167 use super :: * ;
177168 use alloy:: {
@@ -187,13 +178,11 @@ mod tests {
187178 fn test_latest_scanner_builder_pattern ( ) {
188179 let builder = EventScannerBuilder :: latest ( 3 )
189180 . max_block_range ( 25 )
190- . block_confirmations ( 5 )
191181 . from_block ( BlockNumberOrTag :: Number ( 50 ) )
192182 . to_block ( BlockNumberOrTag :: Number ( 150 ) )
193183 . max_concurrent_fetches ( 10 ) ;
194184
195185 assert_eq ! ( builder. block_range_scanner. max_block_range, 25 ) ;
196- assert_eq ! ( builder. config. block_confirmations, 5 ) ;
197186 assert_eq ! ( builder. config. max_concurrent_fetches, 10 ) ;
198187 assert_eq ! ( builder. config. count, 3 ) ;
199188 assert_eq ! ( builder. config. from_block, BlockNumberOrTag :: Number ( 50 ) . into( ) ) ;
@@ -208,7 +197,6 @@ mod tests {
208197 assert_eq ! ( builder. config. to_block, BlockNumberOrTag :: Earliest . into( ) ) ;
209198 assert_eq ! ( builder. config. count, 10 ) ;
210199 assert_eq ! ( builder. config. max_concurrent_fetches, DEFAULT_MAX_CONCURRENT_FETCHES ) ;
211- assert_eq ! ( builder. config. block_confirmations, DEFAULT_BLOCK_CONFIRMATIONS ) ;
212200 }
213201
214202 #[ test]
@@ -218,8 +206,6 @@ mod tests {
218206 . from_block ( 20 )
219207 . to_block ( 100 )
220208 . to_block ( 200 )
221- . block_confirmations ( 5 )
222- . block_confirmations ( 7 )
223209 . max_block_range ( 50 )
224210 . max_block_range ( 60 )
225211 . max_concurrent_fetches ( 10 )
@@ -228,24 +214,10 @@ mod tests {
228214 assert_eq ! ( builder. config. count, 3 ) ;
229215 assert_eq ! ( builder. config. from_block, BlockNumberOrTag :: Number ( 20 ) . into( ) ) ;
230216 assert_eq ! ( builder. config. to_block, BlockNumberOrTag :: Number ( 200 ) . into( ) ) ;
231- assert_eq ! ( builder. config. block_confirmations, 7 ) ;
232217 assert_eq ! ( builder. config. max_concurrent_fetches, 20 ) ;
233218 assert_eq ! ( builder. block_range_scanner. max_block_range, 60 ) ;
234219 }
235220
236- #[ tokio:: test]
237- async fn accepts_zero_confirmations ( ) -> anyhow:: Result < ( ) > {
238- let anvil = Anvil :: new ( ) . try_spawn ( ) . unwrap ( ) ;
239- let provider = ProviderBuilder :: new ( ) . connect_http ( anvil. endpoint_url ( ) ) ;
240-
241- let scanner =
242- EventScannerBuilder :: latest ( 1 ) . block_confirmations ( 0 ) . connect ( provider) . await ?;
243-
244- assert_eq ! ( scanner. config. block_confirmations, 0 ) ;
245-
246- Ok ( ( ) )
247- }
248-
249221 #[ tokio:: test]
250222 async fn test_latest_returns_error_with_zero_count ( ) {
251223 let provider = RootProvider :: < Ethereum > :: new ( RpcClient :: mocked ( Asserter :: new ( ) ) ) ;
0 commit comments