test: expose test provider url

This commit is contained in:
Georgios Konstantopoulos 2022-05-18 13:40:56 -07:00
parent 96391a05fa
commit 4c75e4ae19
1 changed files with 7 additions and 4 deletions

View File

@ -698,13 +698,16 @@ pub mod test_provider {
Self { keys: Mutex::new(keys.iter().cycle()), network: network.to_owned() }
}
pub fn provider(&self) -> Provider<Http> {
let url = format!(
pub fn url(&self) -> String {
format!(
"https://{}.infura.io/v3/{}",
self.network,
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")]