test: expose test provider url
This commit is contained in:
parent
96391a05fa
commit
4c75e4ae19
|
@ -698,13 +698,16 @@ pub mod test_provider {
|
||||||
Self { keys: Mutex::new(keys.iter().cycle()), network: network.to_owned() }
|
Self { keys: Mutex::new(keys.iter().cycle()), network: network.to_owned() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn provider(&self) -> Provider<Http> {
|
pub fn url(&self) -> String {
|
||||||
let url = format!(
|
format!(
|
||||||
"https://{}.infura.io/v3/{}",
|
"https://{}.infura.io/v3/{}",
|
||||||
self.network,
|
self.network,
|
||||||
self.keys.lock().unwrap().next().unwrap()
|
self.keys.lock().unwrap().next().unwrap()
|
||||||
);
|
)
|
||||||
Provider::try_from(url.as_str()).unwrap()
|
}
|
||||||
|
|
||||||
|
pub fn provider(&self) -> Provider<Http> {
|
||||||
|
Provider::try_from(self.url().as_str()).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "ws")]
|
#[cfg(feature = "ws")]
|
||||||
|
|
Loading…
Reference in New Issue