From beffe32f15aa00c455722040517d589d81f242a8 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Sun, 13 Mar 2022 11:29:09 -0700 Subject: [PATCH] fix: feature-gate TestProvider.ws fn --- ethers-providers/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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,