fix: feature-gate TestProvider.ws fn

This commit is contained in:
Georgios Konstantopoulos 2022-03-13 11:29:09 -07:00
parent a02d5a8174
commit beffe32f15
1 changed files with 3 additions and 2 deletions

View File

@ -664,7 +664,7 @@ pub use test_provider::{GOERLI, MAINNET, RINKEBY, ROPSTEN};
/// to prevent rate limits /// to prevent rate limits
pub mod test_provider { pub mod test_provider {
use super::*; use super::*;
use crate::{Http, Ws}; use crate::Http;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use std::{convert::TryFrom, iter::Cycle, slice::Iter, sync::Mutex}; 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() Provider::try_from(url.as_str()).unwrap()
} }
pub async fn ws(&self) -> Provider<Ws> { #[cfg(feature = "ws")]
pub async fn ws(&self) -> Provider<crate::Ws> {
let url = format!( let url = format!(
"wss://{}.infura.io/ws/v3/{}", "wss://{}.infura.io/ws/v3/{}",
self.network, self.network,