diff --git a/ethers-providers/src/lib.rs b/ethers-providers/src/lib.rs index 77f1298a..e373e085 100644 --- a/ethers-providers/src/lib.rs +++ b/ethers-providers/src/lib.rs @@ -664,7 +664,7 @@ pub use test_provider::{GOERLI, MAINNET, RINKEBY, ROPSTEN}; /// to prevent rate limits pub mod test_provider { use super::*; - use crate::{Http, Ws}; + use crate::Http; use once_cell::sync::Lazy; use std::{convert::TryFrom, iter::Cycle, slice::Iter, sync::Mutex}; @@ -706,7 +706,8 @@ pub mod test_provider { Provider::try_from(url.as_str()).unwrap() } - pub async fn ws(&self) -> Provider { + #[cfg(feature = "ws")] + pub async fn ws(&self) -> Provider { let url = format!( "wss://{}.infura.io/ws/v3/{}", self.network,