File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed
Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -15,29 +15,6 @@ use tracing::{error, info};
1515///
1616/// This wrapper around Alloy providers automatically handles retries,
1717/// timeouts, and error logging for RPC calls.
18- ///
19- /// # Example
20- ///
21- /// ```rust,no_run
22- /// # use alloy::{
23- /// # network::Ethereum,
24- /// # providers::{RootProvider, WsConnect},
25- /// # rpc::client::ClientBuilder,
26- /// # };
27- /// # use event_scanner::safe_provider::SafeProvider;
28- /// # use std::time::Duration;
29- ///
30- /// async fn create_safe_provider() -> Result<(), Box<dyn std::error::Error>> {
31- /// let provider = RootProvider::<Ethereum>::new(
32- /// ClientBuilder::default().ws(WsConnect::new("wss://localhost:8000")).await?,
33- /// );
34- /// let safe_provider =
35- /// SafeProvider::new(provider).max_timeout(Duration::from_secs(30)).max_retries(5);
36- ///
37- /// let block = safe_provider.get_block_by_number(12345.into()).await?;
38- /// Ok(())
39- /// }
40- /// ```
4118#[ derive( Clone ) ]
4219pub struct SafeProvider < N : Network > {
4320 provider : RootProvider < N > ,
You can’t perform that action at this time.
0 commit comments